summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2019-03-29 18:14:19 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2019-04-08 14:48:47 -0400
commit20db20fd8206413361dde31eec67139467429bea (patch)
treeb67d6ffc89886cac600c8bf37b07205c624a7774 /src/mongo
parent28a361799cf6a0d7ea1c3196b19aa9a75795b56d (diff)
downloadmongo-20db20fd8206413361dde31eec67139467429bea.tar.gz
SERVER-40504 Check for interruption before checking for stepdown in awaitReplication()
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index b8a102ca872..688b18807ee 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -1659,6 +1659,11 @@ Status ReplicationCoordinatorImpl::_awaitReplication_inlock(
return Status::OK();
}
+ auto interruptStatus = opCtx->checkForInterruptNoAssert();
+ if (!interruptStatus.isOK()) {
+ return interruptStatus;
+ }
+
auto checkForStepDown = [&]() -> Status {
if (replMode == modeReplSet && !_memberState.primary()) {
return {ErrorCodes::PrimarySteppedDown,
@@ -1686,11 +1691,6 @@ Status ReplicationCoordinatorImpl::_awaitReplication_inlock(
return stepdownStatus;
}
- auto interruptStatus = opCtx->checkForInterruptNoAssert();
- if (!interruptStatus.isOK()) {
- return interruptStatus;
- }
-
if (writeConcern.wMode.empty()) {
if (writeConcern.wNumNodes < 1) {
return Status::OK();