summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authorCheahuychou Mao <cheahuychou.mao@mongodb.com>2020-08-09 15:10:35 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-24 21:53:49 +0000
commit118c3fad1141230435881a92865025b863376697 (patch)
treedce663b347801c6cba807d9c0870378658c449e2 /src/mongo/db/commands
parent9d94da72affe76ad20cd13d20c555676782145c6 (diff)
downloadmongo-118c3fad1141230435881a92865025b863376697.tar.gz
SERVER-50093 Test that donor supports running multiple tenant migrations concurrently
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/tenant_migration_donor_cmds.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/commands/tenant_migration_donor_cmds.cpp b/src/mongo/db/commands/tenant_migration_donor_cmds.cpp
index ec9c2a74946..c05d99514ad 100644
--- a/src/mongo/db/commands/tenant_migration_donor_cmds.cpp
+++ b/src/mongo/db/commands/tenant_migration_donor_cmds.cpp
@@ -30,6 +30,7 @@
#include "mongo/db/commands.h"
#include "mongo/db/commands/tenant_migration_donor_cmds_gen.h"
#include "mongo/db/repl/primary_only_service.h"
+#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/db/repl/tenant_migration_donor_service.h"
#include "mongo/db/repl/tenant_migration_donor_util.h"
@@ -48,6 +49,15 @@ public:
void typedRun(OperationContext* opCtx) {
const RequestType& requestBody = request();
+ // TODO (SERVER-50483): Make donorStartMigration command check that the donor's host
+ // is not present in 'recipientConnectionString'
+ const auto donorConnectionString =
+ repl::ReplicationCoordinator::get(opCtx)->getConfig().getConnectionString();
+ uassert(ErrorCodes::InvalidOptions,
+ "recipient must be different from donor",
+ donorConnectionString.toString() !=
+ requestBody.getRecipientConnectionString().toString());
+
const auto donorStateDoc =
TenantMigrationDonorDocument(requestBody.getMigrationId(),
requestBody.getRecipientConnectionString().toString(),