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

Perform the shardVersion recovery and refresh on a separate thread from that of the user request

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0
    • Component/s: Sharding
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2020-04-06, Sharding 2020-05-04, Sharding 2020-05-18, Sharding 2020-06-01, Sharding 2020-06-15
    • Linked BF Score:
      57

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pierlauro.sciarelli Pierlauro Sciarelli
              Reporter:
              kaloian.manassiev Kaloian Manassiev
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: