diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2017-03-03 11:25:44 -0500 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2017-03-06 09:57:40 -0500 |
commit | befb3ab22daa1f6e0db54af4caa426cfca1b7cd2 (patch) | |
tree | d2c205c6a4a7dc9e85d47de281d35a3098ffc5b5 /src/mongo/db/exec | |
parent | 02501866c2fbccf5cec59c8103686972e8e7bb15 (diff) | |
download | mongo-befb3ab22daa1f6e0db54af4caa426cfca1b7cd2.tar.gz |
SERVER-26965 Use RAII type for turning off replicated writes.
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r-- | src/mongo/db/exec/delete.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/exec/update.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp index 0f3e09314e7..884e5f01538 100644 --- a/src/mongo/db/exec/delete.cpp +++ b/src/mongo/db/exec/delete.cpp @@ -269,7 +269,7 @@ void DeleteStage::doRestoreState() { uassert(28537, str::stream() << "Demoted from primary while removing from " << ns.ns(), !getOpCtx()->writesAreReplicated() || - repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(ns)); + repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(getOpCtx(), ns)); } unique_ptr<PlanStageStats> DeleteStage::getStats() { diff --git a/src/mongo/db/exec/update.cpp b/src/mongo/db/exec/update.cpp index b5dbe6eff99..a1b43a2e21d 100644 --- a/src/mongo/db/exec/update.cpp +++ b/src/mongo/db/exec/update.cpp @@ -1003,7 +1003,7 @@ Status UpdateStage::restoreUpdateState() { // We may have stepped down during the yield. bool userInitiatedWritesAndNotPrimary = getOpCtx()->writesAreReplicated() && - !repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(nsString); + !repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(getOpCtx(), nsString); if (userInitiatedWritesAndNotPrimary) { return Status(ErrorCodes::PrimarySteppedDown, |