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

Race while setting replication maintenance mode.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.14, 4.0.13, 3.4.23
    • Fix Version/s: 4.3.1, 4.2.3, 4.0.15
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2, v4.0
    • Sprint:
      Repl 2019-11-04

      Description

      Definitely affects 4.0.13, but on inspection the same logic appears to be present in 4.2.

      When marking a node as too stale before moving into maintenance, an optimization occurs to only perform the maintenance mode transition once. However, if this races (an election starts), we will return out of this function without ever successfully setting maintenance mode, allowing the member to remain in secondary state until restart.

      2019-08-28T12:28:51.035+0000 E REPL     [rsBackgroundSync] too stale to catch up -- entering maintenance mode
      2019-08-28T12:28:51.943+0000 W REPL     [rsBackgroundSync] Failed to transition into maintenance mode: NotSecondary: currently running for election
      

      https://github.com/mongodb/mongo/blob/r4.0.13/src/mongo/db/repl/bgsync.cpp#L359

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: