diff options
Diffstat (limited to 'src/mongo/db/s/set_shard_version_command.cpp')
-rw-r--r-- | src/mongo/db/s/set_shard_version_command.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/s/set_shard_version_command.cpp b/src/mongo/db/s/set_shard_version_command.cpp index 63818e7fe89..6dca94efffd 100644 --- a/src/mongo/db/s/set_shard_version_command.cpp +++ b/src/mongo/db/s/set_shard_version_command.cpp @@ -229,8 +229,8 @@ public: auto css = CollectionShardingState::get(opCtx, nss); const ChunkVersion collectionShardVersion = - (css->getMetadata() ? css->getMetadata()->getShardVersion() - : ChunkVersion::UNSHARDED()); + (css->getMetadata(opCtx) ? css->getMetadata(opCtx)->getShardVersion() + : ChunkVersion::UNSHARDED()); if (requestedVersion.isWriteCompatibleWith(collectionShardVersion)) { // MongoS and MongoD agree on what is the collection's shard version @@ -341,7 +341,7 @@ public: AutoGetCollection autoColl(opCtx, nss, MODE_IS); ChunkVersion currVersion = ChunkVersion::UNSHARDED(); - auto collMetadata = CollectionShardingState::get(opCtx, nss)->getMetadata(); + auto collMetadata = CollectionShardingState::get(opCtx, nss)->getMetadata(opCtx); if (collMetadata) { currVersion = collMetadata->getShardVersion(); } |