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

Implement recovery of a shard's `shardVersion` before it is allowed to perform version checking

    • Fully Compatible
    • Sharding 2020-05-18, Sharding 2020-06-01, Sharding 2020-06-15
    • 38

      The sharding migration commit protocol does not perform a proper 2-phase commit in order to have the minimum possible latency impact in the steady state. Because of this, the following theoretical sequence of events is possible:

      • The current primary of a shard is just about to commit migration against the config server
      • A new primary is elected, which refreshes from the config server before the commit from the previous primary has reached it
      • The new primary sees old shardVersion (and as a result also filtering metadata) and incorrectly accepts writes which are supposed to go to a different shard

      The RangeDeleter project implemented a command to bump a chunk's shard version and also added a check for chunk version equality as part of the migration commit. We should package that logic into an asynchronous task and make sure that forceFilteringMetadataRefresh executes that recovery logic before accepting the shardVersion returned from the config server.

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

              Created:
              Updated:
              Resolved: