summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authorJordi Serra Torrens <jordi.serra-torrens@mongodb.com>2021-04-23 16:05:41 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-04-28 10:09:08 +0000
commited353944eeba3cc4214e2f2bf6c998a4f2ccae21 (patch)
tree5e1f46b95ccb6a444ca2b56c14cd0644c9480b74 /src/mongo/db/commands
parentcc69d699417c64335942cbadcbdd3c2b886debd8 (diff)
downloadmongo-ed353944eeba3cc4214e2f2bf6c998a4f2ccae21.tar.gz
SERVER-55898 Implement a serialiser between Sharded DDL and FCV switch between the old and new metadata format
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/SConscript1
-rw-r--r--src/mongo/db/commands/set_feature_compatibility_version_command.cpp9
2 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index dad79f9ff64..16dc1d93843 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -502,6 +502,7 @@ env.Library(
'$BUILD_DIR/mongo/db/repl/tenant_migration_recipient_service',
'$BUILD_DIR/mongo/db/rw_concern_d',
'$BUILD_DIR/mongo/db/s/sharding_catalog_manager',
+ '$BUILD_DIR/mongo/db/s/sharding_commands_d',
'$BUILD_DIR/mongo/db/s/transaction_coordinator',
'$BUILD_DIR/mongo/db/server_options_core',
'$BUILD_DIR/mongo/idl/idl_parser',
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 ba2adc904a2..6b358934080 100644
--- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
+++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
@@ -54,6 +54,7 @@
#include "mongo/db/repl/repl_set_config.h"
#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/db/s/config/sharding_catalog_manager.h"
+#include "mongo/db/s/sharding_ddl_coordinator_service.h"
#include "mongo/db/server_options.h"
#include "mongo/db/transaction_history_iterator.h"
#include "mongo/db/vector_clock.h"
@@ -354,9 +355,11 @@ public:
if (request.getPhase() == SetFCVPhaseEnum::kStart) {
invariant(serverGlobalParams.clusterRole == ClusterRole::ShardServer);
if (actualVersion > requestedVersion) {
- // Downgrading
- // TODO SERVER-55898: Release fcvChangeRegion and wait for DDLCoordinators to
- // drain
+ // No more ShardingDDLCoordinators will start because we have already switched
+ // the FCV value to kDowngrading. Wait for the ongoing ones to finish.
+ setFCVCommandLock.unlock();
+ ShardingDDLCoordinatorService::getService(opCtx)
+ ->waitForAllCoordinatorsToComplete(opCtx);
}
// If we are only running phase-1, then we are done
return true;