diff options
Diffstat (limited to 'src/mongo/db/repl/replication_info.cpp')
-rw-r--r-- | src/mongo/db/repl/replication_info.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index c75c7b38880..e0a49f5849f 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -66,7 +66,7 @@ using std::stringstream; namespace repl { -void appendReplicationInfo(OperationContext* txn, BSONObjBuilder& result, int level) { +void appendReplicationInfo(OperationContext* opCtx, BSONObjBuilder& result, int level) { ReplicationCoordinator* replCoord = getGlobalReplicationCoordinator(); if (replCoord->getSettings().usingReplSets()) { IsMasterResponse isMasterResponse; @@ -95,9 +95,9 @@ void appendReplicationInfo(OperationContext* txn, BSONObjBuilder& result, int le list<BSONObj> src; { const NamespaceString localSources{"local.sources"}; - AutoGetCollectionForRead ctx(txn, localSources); + AutoGetCollectionForRead ctx(opCtx, localSources); unique_ptr<PlanExecutor> exec(InternalPlanner::collectionScan( - txn, localSources.ns(), ctx.getCollection(), PlanExecutor::YIELD_MANUAL)); + opCtx, localSources.ns(), ctx.getCollection(), PlanExecutor::YIELD_MANUAL)); BSONObj obj; PlanExecutor::ExecState state; while (PlanExecutor::ADVANCED == (state = exec->getNext(&obj, NULL))) { @@ -124,7 +124,7 @@ void appendReplicationInfo(OperationContext* txn, BSONObjBuilder& result, int le } if (level > 1) { - wassert(!txn->lockState()->isLocked()); + wassert(!opCtx->lockState()->isLocked()); // note: there is no so-style timeout on this connection; perhaps we should have // one. ScopedDbConnection conn(s["host"].valuestr()); @@ -159,7 +159,7 @@ public: return true; } - BSONObj generateSection(OperationContext* txn, const BSONElement& configElement) const { + BSONObj generateSection(OperationContext* opCtx, const BSONElement& configElement) const { if (!getGlobalReplicationCoordinator()->isReplEnabled()) { return BSONObj(); } @@ -167,7 +167,7 @@ public: int level = configElement.numberInt(); BSONObjBuilder result; - appendReplicationInfo(txn, result, level); + appendReplicationInfo(opCtx, result, level); getGlobalReplicationCoordinator()->processReplSetGetRBID(&result); return result.obj(); @@ -182,7 +182,7 @@ public: return false; } - BSONObj generateSection(OperationContext* txn, const BSONElement& configElement) const { + BSONObj generateSection(OperationContext* opCtx, const BSONElement& configElement) const { ReplicationCoordinator* replCoord = getGlobalReplicationCoordinator(); if (!replCoord->isReplEnabled()) { return BSONObj(); @@ -199,7 +199,7 @@ public: BSONObj o; uassert(17347, "Problem reading earliest entry from oplog", - Helpers::getSingleton(txn, oplogNS.c_str(), o)); + Helpers::getSingleton(opCtx, oplogNS.c_str(), o)); result.append("earliestOptime", o["ts"].timestamp()); return result.obj(); } @@ -225,7 +225,7 @@ public: const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required CmdIsMaster() : Command("isMaster", true, "ismaster") {} - virtual bool run(OperationContext* txn, + virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, int, @@ -235,20 +235,20 @@ public: authenticated. */ if (cmdObj["forShell"].trueValue()) { - LastError::get(txn->getClient()).disable(); + LastError::get(opCtx->getClient()).disable(); } // Tag connections to avoid closing them on stepdown. auto hangUpElement = cmdObj["hangUpOnStepDown"]; if (!hangUpElement.eoo() && !hangUpElement.trueValue()) { - auto session = txn->getClient()->session(); + auto session = opCtx->getClient()->session(); if (session) { session->replaceTags(session->getTags() | executor::NetworkInterface::kMessagingPortKeepOpen); } } - auto& clientMetadataIsMasterState = ClientMetadataIsMasterState::get(txn->getClient()); + auto& clientMetadataIsMasterState = ClientMetadataIsMasterState::get(opCtx->getClient()); bool seenIsMaster = clientMetadataIsMasterState.hasSeenIsMaster(); if (!seenIsMaster) { clientMetadataIsMasterState.setSeenIsMaster(); @@ -271,13 +271,13 @@ public: invariant(swParseClientMetadata.getValue()); - swParseClientMetadata.getValue().get().logClientMetadata(txn->getClient()); + swParseClientMetadata.getValue().get().logClientMetadata(opCtx->getClient()); clientMetadataIsMasterState.setClientMetadata( - txn->getClient(), std::move(swParseClientMetadata.getValue())); + opCtx->getClient(), std::move(swParseClientMetadata.getValue())); } - appendReplicationInfo(txn, result, 0); + appendReplicationInfo(opCtx, result, 0); if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) { // If we have feature compatibility version 3.4, use a config server mode that 3.2 @@ -302,10 +302,10 @@ public: "automationServiceDescriptor", static_cast<ServerParameter*>(nullptr)); if (parameter) - parameter->append(txn, result, "automationServiceDescriptor"); + parameter->append(opCtx, result, "automationServiceDescriptor"); - if (txn->getClient()->session()) { - MessageCompressorManager::forSession(txn->getClient()->session()) + if (opCtx->getClient()->session()) { + MessageCompressorManager::forSession(opCtx->getClient()->session()) .serverNegotiate(cmdObj, &result); } |