[SERVER-83751] Remove use of ShardingState in sharded_agg_helpers Created: 30/Nov/23  Updated: 11/Dec/23  Resolved: 11/Dec/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Task Priority: Major - P3
Reporter: George Wangensteen Assignee: George Wangensteen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-83744 Support aggregation in embedded route... Closed
Related
related to SERVER-81023 mongos should not depend on the shard... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2023-12-11, Service Arch 2023-12-25
Participants:

 Description   

sharded_agg_helpers::attachCursorToPipeline can be run from both the router and shard (mongos and mongod). However, thus function uses the ShardingState service-context decoration, which should only be present on mongod, to get the 'local' shardID for use in an optimization.
This is innocuous for now because the ShardingState is never initialized on mongos and the 'default' shardId isn't targeted. But we should remove the use of this shard-role code from code that can run under the router role. Removing ShardingSTate from mongos is tracked via SERVER-81023



 Comments   
Comment by Githook User [ 11/Dec/23 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}

Message: SERVER-83751 Remove use of ShardingState in sharded_agg_helpers

GitOrigin-RevId: 48f7a698e5f059fb3597ff9a9c0b175841c6be96
Branch: master
https://github.com/mongodb/mongo/commit/5b056a675e95ae2173ac9296d0fe25da2c8b87f4

Generated at Thu Feb 08 06:53:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.