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/db/s/op_observer_sharding_impl.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/db/s/op_observer_sharding_impl.cpp')
-rw-r--r-- | src/mongo/db/s/op_observer_sharding_impl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/s/op_observer_sharding_impl.cpp b/src/mongo/db/s/op_observer_sharding_impl.cpp index 5e7a4167185..521c4bf7b4f 100644 --- a/src/mongo/db/s/op_observer_sharding_impl.cpp +++ b/src/mongo/db/s/op_observer_sharding_impl.cpp @@ -55,7 +55,7 @@ const auto getIsMigrating = OperationContext::declareDecoration<bool>(); * restarted. */ void assertIntersectingChunkHasNotMoved(OperationContext* opCtx, - CollectionMetadata const& metadata, + const CollectionMetadata& metadata, const BSONObj& doc) { const auto atClusterTime = repl::ReadConcernArgs::get(opCtx).getArgsAtClusterTime(); if (!atClusterTime) @@ -64,8 +64,9 @@ void assertIntersectingChunkHasNotMoved(OperationContext* opCtx, auto shardKey = metadata.getShardKeyPattern().extractShardKeyFromDoc(doc); // We can assume the simple collation because shard keys do not support non-simple collations. - ChunkManager chunkManagerAtClusterTime(metadata.getChunkManager()->getRoutingHistory(), - atClusterTime->asTimestamp()); + auto cm = metadata.getChunkManager(); + ChunkManager chunkManagerAtClusterTime( + cm->dbPrimary(), cm->dbVersion(), cm->getRoutingHistory(), atClusterTime->asTimestamp()); auto chunk = chunkManagerAtClusterTime.findIntersectingChunkWithSimpleCollation(shardKey); // Throws if the chunk has moved since the timestamp of the running transaction's atClusterTime |