Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54230

Stop returning sorted shard IDs vector from ShardRegistry

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: Backlog
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • Sharding 2021-02-08

      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.

            Assignee:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: