Race while setting replication maintenance mode.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.3.1, 4.2.3, 4.0.15
    • Affects Version/s: 3.6.14, 4.0.13, 3.4.23
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • v4.2, v4.0
    • Repl 2019-11-04
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

      Unable to find source-code formatter for language: text. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      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

              Assignee:
              Lingzhi Deng
              Reporter:
              Kevin Arhelger
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: