Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-74826

Errors CommandOnShardedViewNotSupportedOnMongod on sharded view

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 6.0.2, 6.0.3, 6.0.4, 4.4.21
    • Component/s: None
    • None
    • Query Optimization

      Hello.
      I see a errors CommandOnShardedViewNotSupportedOnMongod  in mongos.log:

      {"t":{"$date":"2023-03-14T16:36:24.640+03:00"},"s":"I",  "c":"QUERY",    "id":4625501, "ctx":"conn26972","msg":"Unable to establish remote cursors","attr":{"error":{"code":169,"codeName":"CommandOnShardedViewNotSupportedOnMongod","errmsg":"Resolved views on sharded collections must be executed by mongos","resolvedView":{"ns":"testdb.test_col_3","pipeline":[{"$unionWith":{"coll":"test_col_1"}},{"$unionWith":{"coll":"test_col_2"}},{"$unionWith":{"coll":"test_col_3"}}],"collation":{"locale":"simple"}}},"nRemotes":0}}

      when using .find() or .findOne() in a view that union sharded collections.

      The data in the collections is accessible through the view, but what does this error mean? And what to do with it?

      My configuration:

      Sharded cluster in 3 shard (2 node + 1 arbiter in each) / debian 11(bullseye)

      mongodb-database-tools 100.6.1
      mongodb-mongosh 1.8.1
      mongodb-org 6.0.4
      mongodb-org-database 6.0.4
      mongodb-org-database-tools-extra 6.0.4
      mongodb-org-mongos 6.0.4
      mongodb-org-server 6.0.4
      mongodb-org-shell 6.0.4
      mongodb-org-tools 6.0.4

        1. repro.js
          0.8 kB
          Edwin Zhou

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            taxmailtest@gmail.com mocxat mocxat
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: