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

Improve the readability of synchronisation between clearFilteringMetadata and onShardVersionMismatch's recovery decision making

    • Fully Compatible
    • Sharding EMEA 2022-09-19

      The condition of whether the on-disk set of MigrationCoordinator documents is consulted, with the state of the CSR from before a release of the CSR lock.

      This means that it is possible that an onShardVersionMismatch, which started concurrently with chunk migration, but got to this condition just when the MigrationSourceManager failed and cleared the filtering metadata due to error, to not actually run recovery when it should.

      This is currently protected by the fact that we only clear the filtering metadata under the critical section so there isn't a bug in practice, but just for the sake of better code readability we should re-take the condition after retaking the CSR lock.

            kaloian.manassiev@mongodb.com Kaloian Manassiev
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            0 Vote for this issue
            3 Start watching this issue