-
Type:
Task
-
Resolution: Won't Do
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description: Adds an isFromAggregateCommand boolean parameter to runAggregate and AggExState, defaulting to true so the aggregate command path is unchanged. The three non-aggregate commands that internally dispatch to runAggregate for view resolution — count_cmd, distinct, find_cmd — pass false to identify themselves.
AggExState stores the value and exposes a getter; no call site reads it yet.
Rationale: Establishes caller intent at the boundary before the consumer lands. When SERVER-42282 adds the subrouter-eligibility decision in run_aggregate.cpp, a non-aggregate command that has internally dispatched to runAggregate must kick back to mongos for sharded view resolution (so the explain output format matches the command's expected shape). Splitting the plumbing from the decision keeps the feature PR's diff tightly focused on the subrouter logic, and the plumbing is mechanical and easy to review.
Caveat for reviewer: The new parameter is set by all non-aggregate call sites but read by no consumer until SERVER-42282 lands. Preferred over bundling because the change is mechanical and touches five files; keeping it separate lets SERVER-42282's diff focus on logic.
- is related to
-
SERVER-42282 Consider replacing CommandOnShardedViewNotSupportedOnMongod mechanism with rewrite / routing from shard
-
- Closed
-