diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2020-08-25 01:42:28 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-01 10:50:45 +0000 |
commit | 9cb82d2e8680717d3002459ba5fdb16036183a17 (patch) | |
tree | 6d49e2f6a2bba23707285e90ec1e8b3beba41400 /src/mongo/s/commands/cluster_clear_jumbo_flag_cmd.cpp | |
parent | ca4df25002a60910b38bfdd8d71eb5bff5a79b49 (diff) | |
download | mongo-9cb82d2e8680717d3002459ba5fdb16036183a17.tar.gz |
SERVER-50505 Make the CatalogCache return ChunkManager(s) directly
... instead of returning the intermediate CachedCollectionRoutingInfo
class. The ChunkManager should be the only class used for routing.
Diffstat (limited to 'src/mongo/s/commands/cluster_clear_jumbo_flag_cmd.cpp')
-rw-r--r-- | src/mongo/s/commands/cluster_clear_jumbo_flag_cmd.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mongo/s/commands/cluster_clear_jumbo_flag_cmd.cpp b/src/mongo/s/commands/cluster_clear_jumbo_flag_cmd.cpp index 9fd74b44b71..0750a0b4b47 100644 --- a/src/mongo/s/commands/cluster_clear_jumbo_flag_cmd.cpp +++ b/src/mongo/s/commands/cluster_clear_jumbo_flag_cmd.cpp @@ -73,10 +73,9 @@ public: } void run(OperationContext* opCtx, rpc::ReplyBuilderInterface* result) override { - auto routingInfo = uassertStatusOK( + const auto cm = uassertStatusOK( Grid::get(opCtx)->catalogCache()->getShardedCollectionRoutingInfoWithRefresh(opCtx, ns())); - const auto cm = routingInfo.cm(); uassert(ErrorCodes::InvalidOptions, "bounds can only have exactly 2 elements", @@ -93,21 +92,20 @@ public: boost::optional<Chunk> chunk; if (request().getFind()) { - BSONObj shardKey = - uassertStatusOK(cm->getShardKeyPattern().extractShardKeyFromQuery( - opCtx, ns(), *request().getFind())); + BSONObj shardKey = uassertStatusOK(cm.getShardKeyPattern().extractShardKeyFromQuery( + opCtx, ns(), *request().getFind())); uassert(51260, str::stream() << "no shard key found in chunk query " << *request().getFind(), !shardKey.isEmpty()); - chunk.emplace(cm->findIntersectingChunkWithSimpleCollation(shardKey)); + chunk.emplace(cm.findIntersectingChunkWithSimpleCollation(shardKey)); } else { auto boundsArray = *request().getBounds(); - BSONObj minKey = cm->getShardKeyPattern().normalizeShardKey(boundsArray.front()); - BSONObj maxKey = cm->getShardKeyPattern().normalizeShardKey(boundsArray.back()); + BSONObj minKey = cm.getShardKeyPattern().normalizeShardKey(boundsArray.front()); + BSONObj maxKey = cm.getShardKeyPattern().normalizeShardKey(boundsArray.back()); - chunk.emplace(cm->findIntersectingChunkWithSimpleCollation(minKey)); + chunk.emplace(cm.findIntersectingChunkWithSimpleCollation(minKey)); uassert(51261, str::stream() << "no chunk found with the shard key bounds " @@ -117,7 +115,7 @@ public: } ConfigsvrClearJumboFlag configCmd( - ns(), cm->getVersion().epoch(), chunk->getMin(), chunk->getMax()); + ns(), cm.getVersion().epoch(), chunk->getMin(), chunk->getMax()); configCmd.setDbName(request().getDbName()); auto configShard = Grid::get(opCtx)->shardRegistry()->getConfigShard(); |