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

Allow change stream with updateLookup to run directly against a shard mongoD in a sharded cluster

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.2
    • Sprint:
      Query 2019-12-16
    • Case:

      Description

      FTS needs the ability to run an updateLookup change stream directly against a shard mongoD in a cluster. At present, this is not possible, because MongoInterfaceShardServer::attachCursorSourceToPipeline only expects to run in the context of a $lookup, and therefore uasserts if the collection is sharded.

      When a change stream specifies {fullDocument: "updateLookup"} and we come across an update event, we do the updateLookup here. This calls into MongoInterfaceStandalone::lookupSingleDocument and eventually reaches MongoInterfaceStandalone::makePipeline. When this attempts to call attachCursorSourceToPipeline, though, the fact that this is a shard server becomes relevant. Instead of calling MongoInterfaceStandalone::attachCursorSourceToPipeline, we instead call MongoInterfaceShardServer::attachCursorSourceToPipeline. We only expect this to be called for $lookup, never for a change stream; and so we unconditionally throw if the collection we are attempting to read from is sharded.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: