Refine collection shard key might try to release the critical section of a migration

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.2.0-rc0, 7.1.0-rc1
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Sharding EMEA
    • Fully Compatible
    • ALL
    • v7.1
    • Sharding EMEA 2023-09-04
    • 135
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-76486 added a new implementation of refineCollectionShardKey that resumes migrations in the same phase of the release of the critical section. If there is a stepdown while trying to resume migrations, but the operation succeeds, then the balancer might start sending _shardsvrMoveRange commands to shards while the coordinator is retrying the phase, which causes a race for the critical section, if the migration wins this race, then the refineCollectionShardKey will fail because it will try to release a critical section with a different reason.

      We should set the allowMigrations flag in a different phase than the release of the critical section.

              Assignee:
              Marcos José Grillo Ramirez
              Reporter:
              Marcos José Grillo Ramirez
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: