diff options
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/tenant_migration_donor_service.cpp | 11 | ||||
-rw-r--r-- | src/mongo/db/repl/tenant_migration_recipient_service.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/repl/tenant_migration_util.cpp | 13 | ||||
-rw-r--r-- | src/mongo/db/repl/tenant_migration_util.h | 6 |
4 files changed, 10 insertions, 23 deletions
diff --git a/src/mongo/db/repl/tenant_migration_donor_service.cpp b/src/mongo/db/repl/tenant_migration_donor_service.cpp index 8f1e7166ac4..94d6cf0a802 100644 --- a/src/mongo/db/repl/tenant_migration_donor_service.cpp +++ b/src/mongo/db/repl/tenant_migration_donor_service.cpp @@ -400,13 +400,12 @@ TenantMigrationDonorService::Instance::_fetchAndStoreRecipientClusterTimeKeyDocs return keyDocs; }) - .then( - [this, self = shared_from_this(), executor, serviceToken, instanceToken](auto keyDocs) { - checkIfReceivedDonorAbortMigration(serviceToken, instanceToken); + .then([this, self = shared_from_this(), executor, serviceToken, instanceToken]( + auto keyDocs) { + checkIfReceivedDonorAbortMigration(serviceToken, instanceToken); - tenant_migration_util::storeExternalClusterTimeKeyDocsAndRefreshCache( - executor, std::move(keyDocs)); - }); + tenant_migration_util::storeExternalClusterTimeKeyDocs(executor, std::move(keyDocs)); + }); } ExecutorFuture<repl::OpTime> TenantMigrationDonorService::Instance::_insertStateDoc( diff --git a/src/mongo/db/repl/tenant_migration_recipient_service.cpp b/src/mongo/db/repl/tenant_migration_recipient_service.cpp index 1768100e54a..e251adc76c8 100644 --- a/src/mongo/db/repl/tenant_migration_recipient_service.cpp +++ b/src/mongo/db/repl/tenant_migration_recipient_service.cpp @@ -1360,8 +1360,7 @@ void TenantMigrationRecipientService::Instance::_fetchAndStoreDonorClusterTimeKe _serviceContext, _migrationUuid, doc)); } - tenant_migration_util::storeExternalClusterTimeKeyDocsAndRefreshCache(_scopedExecutor, - std::move(keyDocs)); + tenant_migration_util::storeExternalClusterTimeKeyDocs(_scopedExecutor, std::move(keyDocs)); } void TenantMigrationRecipientService::Instance::_compareRecipientAndDonorFCV() const { diff --git a/src/mongo/db/repl/tenant_migration_util.cpp b/src/mongo/db/repl/tenant_migration_util.cpp index a66f88b318f..247da7fdc89 100644 --- a/src/mongo/db/repl/tenant_migration_util.cpp +++ b/src/mongo/db/repl/tenant_migration_util.cpp @@ -58,9 +58,8 @@ ExternalKeysCollectionDocument makeExternalClusterTimeKeyDoc(ServiceContext* ser return externalKeyDoc; } -void storeExternalClusterTimeKeyDocsAndRefreshCache( - std::shared_ptr<executor::ScopedTaskExecutor> executor, - std::vector<ExternalKeysCollectionDocument> keyDocs) { +void storeExternalClusterTimeKeyDocs(std::shared_ptr<executor::ScopedTaskExecutor> executor, + std::vector<ExternalKeysCollectionDocument> keyDocs) { auto opCtxHolder = cc().makeOperationContext(); auto opCtx = opCtxHolder.get(); auto nss = NamespaceString::kExternalKeysCollectionNamespace; @@ -82,14 +81,6 @@ void storeExternalClusterTimeKeyDocsAndRefreshCache( /*fromMigrate=*/false); }); } - - auto validator = LogicalTimeValidator::get(opCtx); - if (validator) { - // Refresh the keys cache to avoid validation errors for external cluster times with - // a keyId that matches the keyId of an internal key since the LogicalTimeValidator - // only refreshes the cache when it cannot find a matching internal key. - validator->refreshKeyManagerCache(opCtx); - } } void createRetryableWritesView(OperationContext* opCtx, Database* db) { diff --git a/src/mongo/db/repl/tenant_migration_util.h b/src/mongo/db/repl/tenant_migration_util.h index a6a750884de..fe467ec5e0c 100644 --- a/src/mongo/db/repl/tenant_migration_util.h +++ b/src/mongo/db/repl/tenant_migration_util.h @@ -140,11 +140,9 @@ ExternalKeysCollectionDocument makeExternalClusterTimeKeyDoc(ServiceContext* ser * For each given ExternalKeysCollectionDocument, inserts it if there is not an existing document in * admin.system.external_validation_keys for it with the same keyId and replicaSetName. Otherwise, * updates the ttlExpiresAt of the existing document if it is less than the new ttlExpiresAt. - * Refreshes the logical validator's cache before returning. */ -void storeExternalClusterTimeKeyDocsAndRefreshCache( - std::shared_ptr<executor::ScopedTaskExecutor> executor, - std::vector<ExternalKeysCollectionDocument> keyDocs); +void storeExternalClusterTimeKeyDocs(std::shared_ptr<executor::ScopedTaskExecutor> executor, + std::vector<ExternalKeysCollectionDocument> keyDocs); /** * Creates a view on the oplog that allows a tenant migration recipient to fetch retryable writes |