summaryrefslogtreecommitdiff
path: root/src/mongo/s/balancer_policy.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2015-08-19 17:14:33 -0400
committerSpencer T Brody <spencer@mongodb.com>2015-08-25 12:56:28 -0400
commitf415aad16ec26a89110a71232dc898218dc5d85c (patch)
tree14cae84b235c52981d8d661b5219d02aab193cf0 /src/mongo/s/balancer_policy.cpp
parenteb0430ee860d22b164cd603ce7186842f72c8537 (diff)
downloadmongo-f415aad16ec26a89110a71232dc898218dc5d85c.tar.gz
SERVER-19875 Add OperationContext to CatalogManager::getAllShards
Diffstat (limited to 'src/mongo/s/balancer_policy.cpp')
-rw-r--r--src/mongo/s/balancer_policy.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/s/balancer_policy.cpp b/src/mongo/s/balancer_policy.cpp
index 55aa205dfd7..1b81d8b3ec5 100644
--- a/src/mongo/s/balancer_policy.cpp
+++ b/src/mongo/s/balancer_policy.cpp
@@ -66,8 +66,10 @@ namespace {
* ShardNotFound if shard by that id is not available on the registry
* NoSuchKey if the version could not be retrieved
*/
-std::string retrieveShardMongoDVersion(ShardId shardId, ShardRegistry* shardRegistry) {
- auto shard = shardRegistry->getShard(shardId);
+std::string retrieveShardMongoDVersion(OperationContext* txn,
+ ShardId shardId,
+ ShardRegistry* shardRegistry) {
+ auto shard = shardRegistry->getShard(txn, shardId);
if (!shard) {
uassertStatusOK({ErrorCodes::ShardNotFound, "Shard not found"});
}
@@ -276,7 +278,7 @@ void DistributionStatus::dump() const {
Status DistributionStatus::populateShardInfoMap(OperationContext* txn, ShardInfoMap* shardInfo) {
try {
vector<ShardType> shards;
- Status status = grid.catalogManager(txn)->getAllShards(&shards);
+ Status status = grid.catalogManager(txn)->getAllShards(txn, &shards);
if (!status.isOK()) {
return status;
}
@@ -285,10 +287,10 @@ Status DistributionStatus::populateShardInfoMap(OperationContext* txn, ShardInfo
std::set<std::string> dummy;
const long long shardSizeBytes = uassertStatusOK(
- shardutil::retrieveTotalShardSize(shardData.getName(), grid.shardRegistry()));
+ shardutil::retrieveTotalShardSize(txn, shardData.getName(), grid.shardRegistry()));
const std::string shardMongodVersion =
- retrieveShardMongoDVersion(shardData.getName(), grid.shardRegistry());
+ retrieveShardMongoDVersion(txn, shardData.getName(), grid.shardRegistry());
ShardInfo newShardEntry(shardData.getMaxSizeMB(),
shardSizeBytes / 1024 / 1024,