-
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: Introduces CommandHelpers::runWithCommandErrorHandling, a generic wrapper that runs a function inside command dispatch's standard error-handling pattern (rethrow StaleConfig, convert other DBExceptions into a command error reply via appendCommandStatusNoThrow) and returns the resulting BSONObj.
Refactors count_cmd.cpp::runCountAsAgg to call runAggregate directly through this helper, replacing the current CommandHelpers::runCommandDirectly path that was constructing an OpMsgRequest solely to reuse its error-handling shell.
Rationale: The existing runCountAsAgg path serializes the aggregate command back into BSON and reparses it through command dispatch purely for error handling — wasteful and indirect. Extracting the error-handling pattern into a small reusable helper lets count dispatch aggregate directly. The helper also unblocks upcoming subrouter work (SERVER-42282) which needs the same error-handling shell around internal synchronous calls.
- is related to
-
SERVER-42282 Consider replacing CommandOnShardedViewNotSupportedOnMongod mechanism with rewrite / routing from shard
-
- Closed
-