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

Improve alignment of InternalSearchMongotRemoteSpec and the actual document source

    • Query Integration
    • Fully Compatible
    • QI 2024-06-10
    • 200

      The code to construct DocumentSourceInternalSearchMongotRemote is tricky to work with and brittle to extend since some fields are set based on the values of fields in the spec and some are set separately. It's especially confusing for fields like mongotDocsRequested/limit, requiresSearchSequenceToken, metadataMergeProtocolVersion, and requiresSerachMetaCursor since those fields are included in the spec but some are set via explicit constructor arguments rather than from the spec. Because of the spec, this is also confusing in DocumentSourceSearch, where some fields are stored doubly in the spec and the document source.

      This is a direct result of there being so many ways this stage could be constructed (desugared from $search on mongos, likewise on mongod, constructed directly on mongod from a mongos request). We should make an effort to commit to a clear strategy of passing this information around.

      This work may be unnecessary is we plan to do remove $_internalSearchMongotRemote in SERVER-84652 in the near future.

            Assignee:
            will.buerger@mongodb.com Will Buerger
            Reporter:
            will.buerger@mongodb.com Will Buerger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: