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

Update sharded aggregation helpers to operate over AggregateCommandRequest

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability

      sharded_agg_helpers.h/cpp and cluster_aggregation_planner.h/cpp provide a number of helper functions used to facilitate sharded aggregations. The entrypoints, such as createPassthroughCommandForShard, accept a Document argument containing the serialized aggregation command, which is then mutated (e.g. in genericTransformForShards) to be ready for sending to shards.

      Operating over the command request in this manner can make the code hard to read and error-prone (e.g. typos in key names, using the wrong types for certain fields, etc). Also, serializing to Document and then back to BSON can be bad for performance. These functions also can't take advantage of any helpers that operate over IDL-defined structs and thus require their own versions that operate over BSON.

      For these reasons and to continue the transition away from mutating/inspecting arbitrary BSON throughout the server in general, we should update these functions to operate over AggregateCommandRequest instead.

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: