summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2019-02-06 17:55:41 -0500
committerMatthew Russotto <matthew.russotto@10gen.com>2019-02-11 14:20:27 -0500
commit8142ee91c63789c2899ab2bed6622ed2f72ed859 (patch)
treebfaa030da33113b89b0b15005c8351ce4c260f7e /src/mongo
parentdc5efe65414ed7cb68049d67681afc590f23c7a1 (diff)
downloadmongo-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.cpp8
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.h3
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
};