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

Rename SplittableDocumentSource to NeedsMergerDocumentSource

    • Fully Compatible
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      When planning how to execute an aggregation command on a sharded cluster, the agg system must "split" the pipeline into two pieces:

      • The part that can be executed in parallel on each targeted shard.
      • The part that must be executed on the merging node. This includes stages like $group, which must aggregate the data from all targeted shards.

      A stage marks itself as requiring execution on the merging shard by inheriting from SplittableDocumentSource. The name reflects the fact that many of the stages which require the merging shard can also be split into two steps: $group, for example, can be executed by grouping on each of the shards and then merging the groups together on the merging shard. In this sense, the $group has been split across the shards part and the merger part of the pipeline.

      In order to better reflect the fact that we use SplittableDocumentSource to mark stages which must happen on the merging shard, even if the stage cannot be split (e.g. $facet), I propose renaming this class to NeedsMergerDocumentSource.

      As part of this change, we may also want to update the code/comments to reflect that the return value of NeedsMergerDocumentSource::getMergeSource() should never be null.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: