diff options
author | Jordi Serra Torrens <jordi.serra-torrens@mongodb.com> | 2022-10-26 07:48:24 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-26 08:42:45 +0000 |
commit | 1ddc20571ad31d622045d80049c4e7879a780a14 (patch) | |
tree | d59c11cbcb41d0c961311b7e317478a42936c280 /src/mongo/db/ops | |
parent | c554c500fde9838b0125d4965b758a4b0b9af158 (diff) | |
download | mongo-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.cpp | 3 |
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) { |