Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
3.6.14, 4.0.13, 3.4.23
-
None
-
Fully Compatible
-
ALL
-
v4.2, v4.0
-
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