summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/commands/set_feature_compatibility_version_command.cpp13
1 files changed, 13 insertions, 0 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 aae37683145..540d8657f6f 100644
--- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
+++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
@@ -80,6 +80,7 @@
#include "mongo/logv2/log.h"
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/s/pm2423_feature_flags_gen.h"
+#include "mongo/s/refine_collection_shard_key_coordinator_feature_flags_gen.h"
#include "mongo/s/resharding/resharding_feature_flag_gen.h"
#include "mongo/stdx/unordered_set.h"
#include "mongo/util/exit.h"
@@ -397,6 +398,18 @@ public:
opCtx, DDLCoordinatorTypeEnum::kCollMod);
}
+ // TODO SERVER-62850 Remove when 6.0 branches-out
+ if (actualVersion > requestedVersion &&
+ !feature_flags::gFeatureFlagRecoverableRefineCollectionShardKeyCoordinator
+ .isEnabledOnVersion(requestedVersion)) {
+ // No more (recoverable) ReshardCollectionCoordinators will start because we
+ // have already switched the FCV value to kDowngrading. Wait for the ongoing
+ // RefineCollectionCoordinators to finish.
+ ShardingDDLCoordinatorService::getService(opCtx)
+ ->waitForCoordinatorsOfGivenTypeToComplete(
+ opCtx, DDLCoordinatorTypeEnum::kRefineCollectionShardKey);
+ }
+
// If we are only running phase-1, then we are done
return true;
}