[SERVER-54230] Stop returning sorted shard IDs vector from ShardRegistry Created: 03/Feb/21  Updated: 29/Oct/23  Resolved: 04/Feb/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: Backlog
Fix Version/s: 4.9.0

Type: Improvement Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt Dependency
has to be done before SERVER-54231 Resharding can leave behind local col... Closed
Related
related to SERVER-40632 Reload shard registry before attempti... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-02-08
Participants:

 Description   

Currently the shard registry is returning a sorted vector of shard IDs:

Even though this is not necessary, many logics in the codebase relies on these two functions and uses the sorted vector of shard IDs. The consequence is that several of our tests are built on the wrong assumption that there is an order of importance among the shards. For instance:

  • We assume that chunks of a new collection will be spread on shard according to their IDs ascending lexical order.
  • We assume that the primary shard of a new database will be the first shard in ascending lexical order with less data on it.
  • We assume that almost all the broadcast communications in the cluster will be carried on in a round robin fashion according to the shard IDs ascending lexical order.

In order to improve horizontal scalability of the cluster it is important that our internal algorithms treats all the shards in the same way and do not assign any specific order of importance to the shards based on their names.



 Comments   
Comment by Githook User [ 04/Feb/21 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-54230 Stop returning sorted shard IDs vector from ShardRegistry
Branch: master
https://github.com/mongodb/mongo/commit/ab44dc370d11b8369627f2473172243ff6cb4d33

Generated at Thu Feb 08 05:32:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.