summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-07-31 08:08:16 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-31 12:32:43 +0000
commit2932b3fd1e55d427f389d60ae5391b88568929b4 (patch)
tree12a23529b6506c9f22f4ea98a8fc77239b55253c
parentbe8229a4fd16ec34be40086dae9e30e5c2a6d726 (diff)
downloadmongo-2932b3fd1e55d427f389d60ae5391b88568929b4.tar.gz
SERVER-55319 ensure FCV is initialized and set to 4.2 before dropping RSTL for index build
-rw-r--r--src/mongo/db/index_builds_coordinator.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp
index 0b38bbcf7a8..36d86a4ed87 100644
--- a/src/mongo/db/index_builds_coordinator.cpp
+++ b/src/mongo/db/index_builds_coordinator.cpp
@@ -786,8 +786,9 @@ void IndexBuildsCoordinator::_runIndexBuildInner(OperationContext* opCtx,
// waiting to acquire the RSTL in mode X.
// We should only drop the RSTL while in FCV 4.2, as prepared transactions can only
// occur in FCV 4.2.
- if (serverGlobalParams.featureCompatibility.getVersion() ==
- ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo42) {
+ if (serverGlobalParams.featureCompatibility.isVersionInitialized() &&
+ serverGlobalParams.featureCompatibility.getVersion() ==
+ ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo42) {
const bool unlocked = opCtx->lockState()->unlockRSTLforPrepare();
invariant(unlocked);
}