summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Golfieri <enrico.golfieri@mongodb.com>2022-11-15 10:15:43 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-15 10:43:28 +0000
commit00953629dc95376384f912e692fdf42ce248ba56 (patch)
tree9641fb80936876479f3c7e504f69cbad7f76e7b4
parenta54a5ca40c4f07606844bb360bb16e969d7c988a (diff)
downloadmongo-00953629dc95376384f912e692fdf42ce248ba56.tar.gz
SERVER-70167 Resumed create coordinator may incorrectly try to release the critical section - 2
-rw-r--r--src/mongo/db/s/create_collection_coordinator.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/s/create_collection_coordinator.cpp b/src/mongo/db/s/create_collection_coordinator.cpp
index 84dbe859961..45300ed6696 100644
--- a/src/mongo/db/s/create_collection_coordinator.cpp
+++ b/src/mongo/db/s/create_collection_coordinator.cpp
@@ -639,7 +639,9 @@ ExecutorFuture<void> CreateCollectionCoordinator::_runImpl(
auto opCtxHolder = cc().makeOperationContext();
auto* opCtx = opCtxHolder.get();
- _releaseCriticalSections(opCtx);
+ // The critical section might have been taken by a migration, we force
+ // to skip the invariant check and we do nothing in case it was taken.
+ _releaseCriticalSections(opCtx, false /* throwIfReasonDiffers */);
}
return status;