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

Improve shard key index inconsistency checks during migrations

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sharding EMEA

      With actual implementation of the shard key index inconsistency checks, if we are running the checkMetadataConsistency cmd in a recipient shard part of a migration, and that shard had no chunks about the collection being migrated (chunk version <0,0>), we will skip the checks.

      https://github.com/10gen/mongo/blob/be31cc047874ed3c6854534bf419021655535034/src/mongo/db/s/metadata_consistency_util.cpp#L230-L249

      This is done because there is a space where the collection is registered on the recipient's shard but it has no indexes yet.

      https://github.com/10gen/mongo/blob/be31cc047874ed3c6854534bf419021655535034/src/mongo/db/s/migration_destination_manager.cpp#L1079 

      The goal of this ticket is to investigate if there is a more optimized way of checking shard key indexes when there are migrations.

      A possible optimistic approach was to first check if the shard key index exists, and if not check if there is a migration running.

            Assignee:
            backlog-server-sharding-emea [DO NOT USE] Backlog - Sharding EMEA
            Reporter:
            pol.pinol@mongodb.com Pol Pinol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: