[SERVER-28829] create generic flag on OperationShardingState to prevent accessing sharded namespaces Created: 17/Apr/17  Updated: 27/Oct/23  Resolved: 02/Nov/22

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.5.6
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Gone away Votes: 0
Labels: MaxH
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-28792 make dropIndexes unversioned again Closed
Assigned Teams:
Sharding
Participants:

 Description   

It can currently be done by setting a shardVersion on some dummy namespace to "UNSHARDED", because OperationShardingState::getShardVersion(const NamespaceString& nss) returns version UNSHARDED if the namespace requested does not match the one set.

It would be nice not to rely on this trick, and instead have an explicit way of ensuring an operation is unsharded.



 Comments   
Comment by Max Hirschhorn [ 02/Nov/22 ]

Admittedly, I don't fully understand the motivation for this ticket however I do believe the problem has already been solved.

  • SERVER-34325 changed OperationShardingState to support multiple NamespaceString although the service entry point only populates a single one from the command request.
  • SERVER-42600 changed OperationShardingState::getShardVersion() to return a boost::optional. And other work in MongoDB 5.0 (PM-1645) made it so shards no longer assume collections are unsharded and instead require recovering information from the config server by having an explicit "unknown" concept for the sharding metadata.
Comment by Esha Maharishi (Inactive) [ 17/Apr/17 ]

The linked ticket is an example of using the "trick."

Generated at Thu Feb 08 04:19:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.