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

Avoid traversing routing table in MigrationDestinationManager

    XMLWordPrintableJSON

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: