summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/get_last_error.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2017-12-15 11:33:30 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2018-01-22 13:51:26 -0500
commitc376f4b80d26028b6a8746f8545a35e390b59bf2 (patch)
treebffed1afdcc737dcbc899af35c84ccd6cbc4d100 /src/mongo/db/commands/get_last_error.cpp
parent50921266423bf59267b08e0f8ee23469ea03d768 (diff)
downloadmongo-c376f4b80d26028b6a8746f8545a35e390b59bf2.tar.gz
SERVER-29519 Removed many usages of getGlobalReplicationCoordinator
Diffstat (limited to 'src/mongo/db/commands/get_last_error.cpp')
-rw-r--r--src/mongo/db/commands/get_last_error.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index a0b66d375ef..567ea05a6e6 100644
--- a/src/mongo/db/commands/get_last_error.cpp
+++ b/src/mongo/db/commands/get_last_error.cpp
@@ -146,7 +146,7 @@ public:
// Always append lastOp and connectionId
Client& c = *opCtx->getClient();
- auto replCoord = repl::getGlobalReplicationCoordinator();
+ auto replCoord = repl::ReplicationCoordinator::get(opCtx);
if (replCoord->getReplicationMode() == repl::ReplicationCoordinator::modeReplSet) {
const repl::OpTime lastOp = repl::ReplClientInfo::forClient(c).getLastOp();
if (!lastOp.isNull()) {
@@ -227,7 +227,7 @@ public:
WriteConcernOptions writeConcern;
if (useDefaultGLEOptions) {
- writeConcern = repl::getGlobalReplicationCoordinator()->getGetLastErrorDefault();
+ writeConcern = repl::ReplicationCoordinator::get(opCtx)->getGetLastErrorDefault();
}
Status status = writeConcern.parse(writeConcernDoc);
@@ -259,7 +259,7 @@ public:
// If we got an electionId, make sure it matches
if (electionIdPresent) {
- if (repl::getGlobalReplicationCoordinator()->getReplicationMode() !=
+ if (repl::ReplicationCoordinator::get(opCtx)->getReplicationMode() !=
repl::ReplicationCoordinator::modeReplSet) {
// Ignore electionIds of 0 from mongos.
if (electionId != OID()) {
@@ -269,9 +269,9 @@ public:
return false;
}
} else {
- if (electionId != repl::getGlobalReplicationCoordinator()->getElectionId()) {
+ if (electionId != repl::ReplicationCoordinator::get(opCtx)->getElectionId()) {
LOG(3) << "oid passed in is " << electionId << ", but our id is "
- << repl::getGlobalReplicationCoordinator()->getElectionId();
+ << repl::ReplicationCoordinator::get(opCtx)->getElectionId();
errmsg = "election occurred after write";
result.append("code", ErrorCodes::WriteConcernFailed);
result.append("codeName",