diff options
author | Jordi Serra Torrens <jordi.serra-torrens@mongodb.com> | 2021-04-28 08:11:54 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-29 08:53:43 +0000 |
commit | 731864699b5e71e57ea6bf27a38670ccfebab652 (patch) | |
tree | c026040b0e3ba20dae37f53d18464cf7519c493f /src/mongo/db/s/config | |
parent | 55ce6c96f9f5ba2774750713a61823408ce1d279 (diff) | |
download | mongo-731864699b5e71e57ea6bf27a38670ccfebab652.tar.gz |
SERVER-56399 Configsvr step-up can fail after stepping-down during setFCV metadata patch-up
Diffstat (limited to 'src/mongo/db/s/config')
-rw-r--r-- | src/mongo/db/s/config/sharding_catalog_manager.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/mongo/db/s/config/sharding_catalog_manager.cpp b/src/mongo/db/s/config/sharding_catalog_manager.cpp index 813c6f3d0d3..a13ddcdcabc 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager.cpp @@ -446,17 +446,22 @@ Status ShardingCatalogManager::_initConfigIndexes(OperationContext* opCtx) { const bool unique = true; auto configShard = Grid::get(opCtx)->shardRegistry()->getConfigShard(); - if (feature_flags::gShardingFullDDLSupportTimestampedVersion.isEnabled( - serverGlobalParams.featureCompatibility)) { - const auto result = createUuidIndexesForConfigChunks(opCtx); - if (result != Status::OK()) { - return result; - } + // (Generic FCV reference): TODO SERVER-53283 Remove the outermost 'if' statement once 5.0 has + // branched out. + if (!serverGlobalParams.featureCompatibility.isUpgradingOrDowngrading() || + !feature_flags::gShardingFullDDLSupportTimestampedVersion.isEnabledAndIgnoreFCV()) { + if (feature_flags::gShardingFullDDLSupportTimestampedVersion.isEnabled( + serverGlobalParams.featureCompatibility)) { + const auto result = createUuidIndexesForConfigChunks(opCtx); + if (result != Status::OK()) { + return result; + } - } else { - const auto result = createNsIndexesForConfigChunks(opCtx); - if (result != Status::OK()) { - return result; + } else { + const auto result = createNsIndexesForConfigChunks(opCtx); + if (result != Status::OK()) { + return result; + } } } |