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

Resharding donor shards cannot complete a shard version refresh after acquiring the critical section, stalling the resharding operation

    • Fully Compatible
    • ALL
    • v5.0
    • Sharding 2021-06-28
    • 134
    • 1

      Shards during a resharding operation rely on a shard version refresh to be triggered after a new primary has stepped up for the DonorStateMachine and RecipientStateMachines to learn of a change to the coordinator's state. However, a shard version refresh won't be able to complete while the critical section is held. This means if the write to acquire the critical section becomes majority-committed but the write to transition to DonorStateEnum::kBlockingWrites doesn't, then the donor shard will be stuck unable to advance past DonorStateEnum::kDonatingOplogEntries. The shard version refresh won't be able to complete while the critical section is held and so the donor shard won't realize it is safe for it to complete its transition to DonorStateEnum::kBlockingWrites.

      The DonorStateEnum::kPreparingToBlockWrites state had been removed as part of SERVER-55677 but could be reintroduced to solve this issue. A donor shard coming up in DonorStateEnum::kPreparingToBlockWrites would mean the donor shard doesn't need to wait for a shard version refresh to complete before it can complete its transition to DonorStateEnum::kBlockingWrites.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: