diff options
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.cpp | 8 | ||||
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.h | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index 1f03000515b..f003bfdba66 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -2700,7 +2700,8 @@ ReplicationCoordinatorImpl::_updateMemberStateFromTopologyCoordinator(WithLock l invariant(!_readWriteAbility->canAcceptNonLocalWrites(lk)); serverGlobalParams.validateFeaturesAsMaster.store(false); - result = kActionSteppedDownOrRemoved; + result = (newState.removed() || newState.rollback()) ? kActionRollbackOrRemoved + : kActionSteppedDown; } else { result = kActionFollowerModeStateChange; } @@ -2805,7 +2806,10 @@ void ReplicationCoordinatorImpl::_performPostMemberStateUpdateAction( case kActionFollowerModeStateChange: _onFollowerModeStateChange(); break; - case kActionSteppedDownOrRemoved: + case kActionRollbackOrRemoved: + _externalState->closeConnections(); + /* FALLTHROUGH */ + case kActionSteppedDown: if (closeConnectionsOnStepdown.load()) { _externalState->closeConnections(); } diff --git a/src/mongo/db/repl/replication_coordinator_impl.h b/src/mongo/db/repl/replication_coordinator_impl.h index 5ed52fecc1f..5632c829867 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.h +++ b/src/mongo/db/repl/replication_coordinator_impl.h @@ -446,7 +446,8 @@ private: */ enum PostMemberStateUpdateAction { kActionNone, - kActionSteppedDownOrRemoved, + kActionSteppedDown, + kActionRollbackOrRemoved, kActionFollowerModeStateChange, kActionStartSingleNodeElection }; |