-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Fully Compatible
Writes, or more specifically commands that can write, should call checkIfCanWriteOrBlock in a loop as described in migrating_tenant_access_blocker.h:
template <typename F> auto migrationConflictRetry(OperationContext* opCtx, const Database* db, F&& f) { while (true) { try { return f(); } catch (const MigrationConflictException&) { MigratingTenantAccessBlocker::get(db).checkIfCanWriteOrBlock(opCtx); } } }
The loop should be above any database or collection locks.
The loop might look slightly different (e.g., not take a 'F' argument and instead wrap some existing code) depending on the implementation.
This ticket should also test that all writes block if the "start blocking" write has occurred.