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

Background sync may erroneously set applied-through during step-up

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 4.2.8
    • 4.9.0, 4.4.2, 4.2.12
    • Replication
    • None
    • Fully Compatible
    • ALL
    • v4.4, v4.2
    • Repl 2020-10-05, Repl 2020-10-19

    Description

      The bgsync _producer() method runs in a loop until stop() is called asynchronously.

      If, after this critical section is run

      https://github.com/mongodb/mongo/blob/ea1ad14260cad77823a549a22a32a97621d58a35/src/mongo/db/repl/bgsync.cpp#L425

      stop() is called (as it would be during step-up), then before

      https://github.com/mongodb/mongo/blob/ea1ad14260cad77823a549a22a32a97621d58a35/src/mongo/db/repl/bgsync.cpp#L441

      is reached, the primary clears the applied-through time (as it normally does), the applied-through time will be re-set to the last applied optime. This state will persist until the next time the node becomes secondary and applies a batch. If the node restarts during that time, it will invariant and need to be re-synced.

      We need to hold the mutex and ensure the producer is running while checking if applied-through is clear and setting it.

      Attachments

        Issue Links

          Activity

            People

              samy.lanka@mongodb.com Samyukta Lanka
              matthew.russotto@mongodb.com Matthew Russotto
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: