summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops
diff options
context:
space:
mode:
authorJordi Serra Torrens <jordi.serra-torrens@mongodb.com>2022-10-26 07:48:24 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-10-26 08:42:45 +0000
commit1ddc20571ad31d622045d80049c4e7879a780a14 (patch)
treed59c11cbcb41d0c961311b7e317478a42936c280 /src/mongo/db/ops
parentc554c500fde9838b0125d4965b758a4b0b9af158 (diff)
downloadmongo-1ddc20571ad31d622045d80049c4e7879a780a14.tar.gz
SERVER-69435 Make the CSS acquisition a RAII
Diffstat (limited to 'src/mongo/db/ops')
-rw-r--r--src/mongo/db/ops/write_ops_exec.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp
index a3ba4c3c6e3..07a7e7bd7a7 100644
--- a/src/mongo/db/ops/write_ops_exec.cpp
+++ b/src/mongo/db/ops/write_ops_exec.cpp
@@ -224,7 +224,8 @@ void assertCanWrite_inlock(OperationContext* opCtx, const NamespaceString& nss)
repl::ReplicationCoordinator::get(opCtx->getServiceContext())
->canAcceptWritesFor(opCtx, nss));
- CollectionShardingState::get(opCtx, nss)->checkShardVersionOrThrow(opCtx);
+ CollectionShardingState::assertCollectionLockedAndAcquire(opCtx, nss)
+ ->checkShardVersionOrThrow(opCtx);
}
void makeCollection(OperationContext* opCtx, const NamespaceString& ns) {