diff options
author | Samy Lanka <samy.lanka@mongodb.com> | 2018-11-07 15:10:08 -0500 |
---|---|---|
committer | Samy Lanka <samy.lanka@mongodb.com> | 2018-11-08 17:28:44 -0500 |
commit | 09f0e3262c5bc5255135338d982acdc5723d5e15 (patch) | |
tree | 587696e37b5eb3fdb43e89d40d5486cea954765f /src/mongo/db/repl/rs_rollback.cpp | |
parent | 75b0e69c471d53675572f32f94f2f67d214d9842 (diff) | |
download | mongo-09f0e3262c5bc5255135338d982acdc5723d5e15.tar.gz |
SERVER-37945 Replace the Global X lock with a ReplicationStateTransitionLockGuard wherever we acquire it for a state transition
Diffstat (limited to 'src/mongo/db/repl/rs_rollback.cpp')
-rw-r--r-- | src/mongo/db/repl/rs_rollback.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index 9c76bbf5b18..1927ffd20ea 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -67,6 +67,7 @@ #include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/repl/replication_coordinator_impl.h" #include "mongo/db/repl/replication_process.h" +#include "mongo/db/repl/replication_state_transition_lock_guard.h" #include "mongo/db/repl/roll_back_local_operations.h" #include "mongo/db/repl/rollback_source.h" #include "mongo/db/repl/rslog.h" @@ -1492,7 +1493,8 @@ void rollback(OperationContext* opCtx, // then. { - Lock::GlobalWrite globalWrite(opCtx); + ReplicationStateTransitionLockGuard transitionGuard(opCtx); + auto status = replCoord->setFollowerMode(MemberState::RS_ROLLBACK); if (!status.isOK()) { log() << "Cannot transition from " << replCoord->getMemberState().toString() << " to " |