diff options
author | Cheahuychou Mao <mao.cheahuychou@gmail.com> | 2021-02-12 16:10:03 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-12 17:59:45 +0000 |
commit | 89ed09c1e9d093983837638a31f17c60b44a5e17 (patch) | |
tree | 0782cafaa1b8b36c398ba6a1a5ad9b55168ced53 | |
parent | 3afb4b31149e5a747e25f2aab611621a99bf8667 (diff) | |
download | mongo-89ed09c1e9d093983837638a31f17c60b44a5e17.tar.gz |
SERVER-54496 Tenant migration donor should not specify timeout for recipientSyncData command
-rw-r--r-- | jstests/replsets/tenant_migration_recipient_sync_data_timeout.js | 42 | ||||
-rw-r--r-- | src/mongo/db/repl/tenant_migration_donor_service.cpp | 4 |
2 files changed, 43 insertions, 3 deletions
diff --git a/jstests/replsets/tenant_migration_recipient_sync_data_timeout.js b/jstests/replsets/tenant_migration_recipient_sync_data_timeout.js new file mode 100644 index 00000000000..e35020abca4 --- /dev/null +++ b/jstests/replsets/tenant_migration_recipient_sync_data_timeout.js @@ -0,0 +1,42 @@ +/** + * Tests that tenant migration does not fail if the recipientSyncData takes a long time to return. + * + * @tags: [requires_fcv_47, requires_majority_read_concern, incompatible_with_eft, + * incompatible_with_windows_tls] + */ + +(function() { +"use strict"; + +load("jstests/libs/fail_point_util.js"); +load("jstests/libs/uuid_util.js"); +load("jstests/replsets/libs/tenant_migration_test.js"); + +const tenantMigrationTest = new TenantMigrationTest({name: jsTestName()}); +if (!tenantMigrationTest.isFeatureFlagEnabled()) { + jsTestLog("Skipping test because the tenant migrations feature flag is disabled"); + return; +} + +const kTenantId = "testTenantId"; + +const recipientPrimary = tenantMigrationTest.getRecipientPrimary(); +configureFailPoint(recipientPrimary, "failCommand", { + failInternalCommands: true, + blockConnection: true, + blockTimeMS: 35 * 1000, + failCommands: ["recipientSyncData"], +}); + +const migrationId = UUID(); +const migrationOpts = { + migrationIdString: extractUUIDFromObject(migrationId), + tenantId: kTenantId, +}; + +const stateRes = assert.commandWorked(tenantMigrationTest.runMigration(migrationOpts)); +assert.eq(stateRes.state, TenantMigrationTest.State.kCommitted); +assert.commandWorked(tenantMigrationTest.forgetMigration(migrationOpts.migrationIdString)); + +tenantMigrationTest.stop(); +})(); diff --git a/src/mongo/db/repl/tenant_migration_donor_service.cpp b/src/mongo/db/repl/tenant_migration_donor_service.cpp index 773ed036475..9f5492abe4b 100644 --- a/src/mongo/db/repl/tenant_migration_donor_service.cpp +++ b/src/mongo/db/repl/tenant_migration_donor_service.cpp @@ -68,7 +68,6 @@ const Backoff kExponentialBackoff(Seconds(1), Milliseconds::max()); const ReadPreferenceSetting kPrimaryOnlyReadPreference(ReadPreference::PrimaryOnly); -const Seconds kRecipientSyncDataTimeout(30); const int kMaxRecipientKeyDocsFindAttempts = 10; bool shouldStopCreatingTTLIndex(Status status, const CancelationToken& token) { @@ -610,8 +609,7 @@ ExecutorFuture<void> TenantMigrationDonorService::Instance::_sendCommandToRecipi NamespaceString::kAdminDb.toString(), std::move(cmdObj), rpc::makeEmptyMetadata(), - nullptr, - kRecipientSyncDataTimeout); + nullptr); request.sslMode = _sslMode; return (_recipientCmdExecutor) |