[SERVER-30025] for sharded read with empty query, target only shards that own data for the collection instead of all shards Created: 06/Jul/17  Updated: 30/Oct/23  Resolved: 26/Sep/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.5.9
Fix Version/s: 3.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Esha Maharishi (Inactive)
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-31232 remove retrying on stale shardVersion... Closed
Duplicate
is duplicated by SERVER-29514 improve scatterGather() and establish... Closed
Related
related to SERVER-30344 prevent shards from implicitly creati... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2017-07-31, Sharding 2017-09-11, Sharding 2017-10-02
Participants:

 Description   

We should fix the regression introduced by the scatterGather interface where, in the absence of a passed-in query, currently all shards are targeted for requests on sharded collections.

Instead, scatterGather() should be changed to only target shards that actually own data for the collection by assuming an empty query and using ChunkManager::getShardIdsForQuery.

In addition, the following commands should be changed to be broadcast and unversioned:

  • createIndexes
  • dropIndex
  • reIndex
  • collMod


 Comments   
Comment by Githook User [ 26/Sep/17 ]

Author:

{'email': 'esha.maharishi@mongodb.com', 'name': 'Esha Maharishi', 'username': 'EshaMaharishi'}

Message: SERVER-30025 for sharded read with empty query, target only shards that own data for the collection instead of all shards
Branch: master
https://github.com/mongodb/mongo/commit/dabde5a17356591ebcb465129bcd5ed5d9236b60

Comment by Esha Maharishi (Inactive) [ 08/Aug/17 ]

Marked as "related to" SERVER-30344 because this ticket is to fix a regression introduced in 3.5.x where we target all shards in cases where we shouldn't. However, createIndexes currently depends on targeting all shards. But creating an index on all shards is actually incorrect, because it causes the collection to implicitly be created without the right collection options (including UUID) on shards that don't own data for the collection yet.

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