Avoid traversing routing table in MigrationDestinationManager

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • v5.0, v4.4, v4.2
    • Sharding EMEA 2023-09-18
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In the migration destination manager, in order to understand if the destination shard already have some chunk, we call CollectionMetadata::getChunks().empty(). This function scans the entire routing table and make a partial copy of it that contains only chunks belonging to the destination shard.

      When the routing table for the collection has many chunks, this calls can be extremely expensive.

      To avoid this overhead, we could simply use CollectionMetadata::currentShardHasAnyChunks() instead.

              Assignee:
              Tommaso Tocci
              Reporter:
              Tommaso Tocci
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: