diff options
author | Jordi Serra Torrens <jordi.serra-torrens@mongodb.com> | 2021-04-14 16:06:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-15 11:31:52 +0000 |
commit | dbadbc031fccc8908e28df83c0e4e1d44cbcb5fc (patch) | |
tree | 571e983d58909da11739cf20109b0f7a19135e67 /src/mongo/db/commands | |
parent | 0502194a53d5a4ed6ac907a8b6481432103ea608 (diff) | |
download | mongo-dbadbc031fccc8908e28df83c0e4e1d44cbcb5fc.tar.gz |
SERVER-55641: Reorganize the FCV upgrade/downgrade configsvr metadata patch-up around the 2-phase setFCV
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/set_feature_compatibility_version_command.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp index 06c509c9ab9..881f3009962 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -368,7 +368,7 @@ private: // TODO SERVER-53283: This block can removed once 5.0 becomes last-lts. // TODO SERVER-53774: Replace kLatest by the version defined in the feature flag IDL if (requestedVersion >= FeatureCompatibility::kLatest) { - ShardingCatalogManager::get(opCtx)->upgradeMetadataFor50(opCtx); + ShardingCatalogManager::get(opCtx)->upgradeMetadataFor50Phase1(opCtx); } // Tell the shards to enter phase-2 of setFCV (fully upgraded) @@ -377,6 +377,12 @@ private: uassertStatusOK( ShardingCatalogManager::get(opCtx)->setFeatureCompatibilityVersionOnShards( opCtx, CommandHelpers::appendMajorityWriteConcern(requestPhase2.toBSON({})))); + + // TODO SERVER-53283: This block can removed once 5.0 becomes last-lts. + // TODO SERVER-53774: Replace kLatest by the version defined in the feature flag IDL + if (requestedVersion >= FeatureCompatibility::kLatest) { + ShardingCatalogManager::get(opCtx)->upgradeMetadataFor50Phase2(opCtx); + } } hangWhileUpgrading.pauseWhileSet(opCtx); @@ -492,7 +498,7 @@ private: // TODO SERVER-53283: This block can removed once 5.0 becomes last-lts. // TODO SERVER-53774: Replace kLatest by the version defined in the feature flag IDL if (requestedVersion < FeatureCompatibility::kLatest) { - ShardingCatalogManager::get(opCtx)->downgradeMetadataToPre50(opCtx); + ShardingCatalogManager::get(opCtx)->downgradeMetadataToPre50Phase1(opCtx); } // Tell the shards to enter phase-2 of setFCV (fully downgraded) @@ -501,6 +507,12 @@ private: uassertStatusOK( ShardingCatalogManager::get(opCtx)->setFeatureCompatibilityVersionOnShards( opCtx, CommandHelpers::appendMajorityWriteConcern(requestPhase2.toBSON({})))); + + // TODO SERVER-53283: This block can removed once 5.0 becomes last-lts. + // TODO SERVER-53774: Replace kLatest by the version defined in the feature flag IDL + if (requestedVersion < FeatureCompatibility::kLatest) { + ShardingCatalogManager::get(opCtx)->downgradeMetadataToPre50Phase2(opCtx); + } } hangWhileDowngrading.pauseWhileSet(opCtx); |