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

Clear list of stable timestamp candidates on Rollback and Initial Sync

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc5
    • Component/s: Replication
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v3.6
    • Sprint:
      Repl 2017-11-13, Repl 2017-12-04
    • Linked BF Score:
      0

      Description

      The list of potential stable timestamp candidates is maintained in memory, in
      ReplicationCoordinatorImpl::_stableTimestampCandidates. It will need to be cleared after recovering to a timestamp or when starting a new initial sync. During rollback, after recovering to the stable timestamp, the replication system will apply oplog entries between the stable timestamp and the common point. Before this oplog application process, we should clear the list of all timestamps except the stable timestamp. The oplog entries between the stable timestamp and the common point may get applied differently than they were originally, so we need to clear the timestamp list before doing this to avoid leaving timestamp candidates in the list that might no longer fall at a consistent point.

      Note on the 'rollbackViaRefetch' algorithm in 3.6:

      For 3.6, where we still use the "rollbackBackViaRefetch" algorithm, we will need to do the following to make sure we are never setting the stable timestamp to a timestamp at an inconsistent state:

      1. Upon entering ROLLBACK, set a flag, dataConsistent=false
      2. Upon reaching minValid, in tryToGoLiveAsASecondary in sync_tail.cpp, set dataConsistent=true, since reaching the minValid optime implies that the database state is now consistent.
      3. We should never add an optime to the set of stable optime candidates in ReplicationCoordinator if dataConsistent=false
      4. Upon leaving ROLLBACK, clear the list of stable optime candidates that are past the current stable optime.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              william.schultz William Schultz (Inactive)
              Reporter:
              william.schultz William Schultz (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: