-
Type: Improvement
-
Resolution: Unresolved
-
Priority: 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.
- is related to
-
SERVER-94115 Refactor Sharded Aggregation code
- Open
- related to
-
SERVER-90827 Generate command serialization methods for passing request through to shards
- Open
-
SERVER-91235 Replace usages of BSON-manipulating functions in cluster_commands_helpers
- Closed