diff options
Diffstat (limited to 'src/mongo/db/repl/tenant_migration_donor_op_observer.cpp')
-rw-r--r-- | src/mongo/db/repl/tenant_migration_donor_op_observer.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp b/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp index e3faa621b15..c789741a087 100644 --- a/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp +++ b/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp @@ -49,9 +49,9 @@ const auto tenantIdToDeleteDecoration = * Initializes the TenantMigrationDonorAccessBlocker for the tenant migration denoted by the given * state doc. */ -void onTransitionToDataSync(OperationContext* opCtx, - const TenantMigrationDonorDocument& donorStateDoc) { - invariant(donorStateDoc.getState() == TenantMigrationDonorStateEnum::kDataSync); +void onTransitionToAbortingIndexBuilds(OperationContext* opCtx, + const TenantMigrationDonorDocument& donorStateDoc) { + invariant(donorStateDoc.getState() == TenantMigrationDonorStateEnum::kAbortingIndexBuilds); auto mtab = std::make_shared<TenantMigrationDonorAccessBlocker>( opCtx->getServiceContext(), @@ -213,15 +213,16 @@ void TenantMigrationDonorOpObserver::onInserts(OperationContext* opCtx, for (auto it = first; it != last; it++) { auto donorStateDoc = tenant_migration_access_blocker::parseDonorStateDocument(it->doc); switch (donorStateDoc.getState()) { - case TenantMigrationDonorStateEnum::kDataSync: - onTransitionToDataSync(opCtx, donorStateDoc); + case TenantMigrationDonorStateEnum::kAbortingIndexBuilds: + onTransitionToAbortingIndexBuilds(opCtx, donorStateDoc); break; + case TenantMigrationDonorStateEnum::kDataSync: case TenantMigrationDonorStateEnum::kBlocking: case TenantMigrationDonorStateEnum::kCommitted: case TenantMigrationDonorStateEnum::kAborted: - uasserted( - ErrorCodes::IllegalOperation, - "cannot insert a donor's state doc with 'state' other than 'data sync'"); + uasserted(ErrorCodes::IllegalOperation, + "cannot insert a donor's state doc with 'state' other than 'aborting " + "index builds'"); break; default: MONGO_UNREACHABLE; @@ -240,6 +241,8 @@ void TenantMigrationDonorOpObserver::onUpdate(OperationContext* opCtx, auto donorStateDoc = tenant_migration_access_blocker::parseDonorStateDocument(args.updateArgs.updatedDoc); switch (donorStateDoc.getState()) { + case TenantMigrationDonorStateEnum::kDataSync: + break; case TenantMigrationDonorStateEnum::kBlocking: onTransitionToBlocking(opCtx, donorStateDoc); break; |