summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/op_observer_sharding_impl.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2020-08-25 01:42:28 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-01 10:50:45 +0000
commit9cb82d2e8680717d3002459ba5fdb16036183a17 (patch)
tree6d49e2f6a2bba23707285e90ec1e8b3beba41400 /src/mongo/db/s/op_observer_sharding_impl.cpp
parentca4df25002a60910b38bfdd8d71eb5bff5a79b49 (diff)
downloadmongo-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.cpp7
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