diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2019-02-06 17:55:41 -0500 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2019-02-11 14:20:27 -0500 |
commit | 8142ee91c63789c2899ab2bed6622ed2f72ed859 (patch) | |
tree | bfaa030da33113b89b0b15005c8351ce4c260f7e /src/mongo | |
parent | dc5efe65414ed7cb68049d67681afc590f23c7a1 (diff) | |
download | mongo-8142ee91c63789c2899ab2bed6622ed2f72ed859.tar.gz |
SERVER-39412 Continue to disconnect on rollback or on removal from the configuration.
Diffstat (limited to 'src/mongo')
-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 }; |