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

$listSearchIndexes behavior should be consistent with other aggregations when the collection does not exist

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.10, 7.2.0-rc0, 7.0.2, 7.1.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Integration
    • Fully Compatible
    • ALL
    • v7.1, v7.0, v6.0
    • QI 2023-08-07, QI 2023-08-21, QI 2023-09-04

      Currently, when the collection does not exist, `$listSearchIndexes` returns a cursor and, when getMore is called on that cursor, a `NamespaceResolution` exception is thrown.

      This does not match how the aggregation pipeline works for other stages.  With a `$group` stage, for example, getMore returns an empty cursor in this case, rather than throwing a `NamespaceResolution` exception.

      Example with `$listSearchIndexes`:

      Aggregate call:
      
      Command: {"aggregate": "slava-test-collection", "pipeline": [{"$listSearchIndexes": {}}], "cursor": {"batchSize": 0}, "$db": "slava-test", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1689011240, "i": 1}}, "signature": {"hash": {"$binary": {"base64": "UbqmSAzjXtJNn8TiKdCv/NBV/SA=", "subType": "00"}}, "keyId": 7253089058631450627}}, "lsid": {"id": {"$binary": {"base64": "yj+/sud8QdKifNmSLv6fDg==", "subType": "04"}}}}
      
      Command reply: {"cursor": {"firstBatch": [], "id": 5529230180027818871, "ns": "slava-test.slava-test-collection"}, "ok": 1.0
      
      Cursor getMore call:
      
      Command: {"getMore": 5529230180027818871, "collection": "slava-test-collection", "$db": "slava-test",
      {"ok": 0.0, "errmsg": "Executor error during getMore :: caused by :: Collection 'slava-test.slava-test-collection' does not exist.", "code": 26, "codeName": "NamespaceNotFound"}}

       

            Assignee:
            alyssa.clark@mongodb.com Alyssa Clark
            Reporter:
            evan.plotkin@mongodb.com Evan Plotkin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: