diff options
Diffstat (limited to 'src/mongo/s/sharding_uptime_reporter.cpp')
-rw-r--r-- | src/mongo/s/sharding_uptime_reporter.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mongo/s/sharding_uptime_reporter.cpp b/src/mongo/s/sharding_uptime_reporter.cpp index d2d170df176..8d507dbfce6 100644 --- a/src/mongo/s/sharding_uptime_reporter.cpp +++ b/src/mongo/s/sharding_uptime_reporter.cpp @@ -57,7 +57,9 @@ std::string constructInstanceIdString() { * Reports the uptime status of the current instance to the config.pings collection. This method * is best-effort and never throws. */ -void reportStatus(OperationContext* txn, const std::string& instanceId, const Timer& upTimeTimer) { +void reportStatus(OperationContext* opCtx, + const std::string& instanceId, + const Timer& upTimeTimer) { MongosType mType; mType.setName(instanceId); mType.setPing(jsTime()); @@ -67,8 +69,8 @@ void reportStatus(OperationContext* txn, const std::string& instanceId, const Ti mType.setMongoVersion(VersionInfoInterface::instance().version().toString()); try { - Grid::get(txn)->catalogClient(txn)->updateConfigDocument( - txn, + Grid::get(opCtx)->catalogClient(opCtx)->updateConfigDocument( + opCtx, MongosType::ConfigNS, BSON(MongosType::name(instanceId)), BSON("$set" << mType.toBSON()), @@ -99,11 +101,12 @@ void ShardingUptimeReporter::startPeriodicThread() { while (!globalInShutdownDeprecated()) { { - auto txn = cc().makeOperationContext(); - reportStatus(txn.get(), instanceId, upTimeTimer); + auto opCtx = cc().makeOperationContext(); + reportStatus(opCtx.get(), instanceId, upTimeTimer); - auto status = - Grid::get(txn.get())->getBalancerConfiguration()->refreshAndCheck(txn.get()); + auto status = Grid::get(opCtx.get()) + ->getBalancerConfiguration() + ->refreshAndCheck(opCtx.get()); if (!status.isOK()) { warning() << "failed to refresh mongos settings" << causedBy(status); } |