Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49174

Make writes call MigratingTenantAccessBlocker::checkIfCanWriteOrThrow in op observer

    • Fully Compatible
    • Sharding 2020-07-27, Sharding 2020-08-10

      In the op observer after being assigned an OpTime (e.g., where this happens for inserts), writes should get the MigratingTenantAccessBlocker for the database they're in from the MigratingTenantAccessBlockerByPrefix and call checkIfCanWriteOrThrow on it.

      Note that this should be done in all op observers for user writes, e.g. includes things like collMod, createIndex, and drop.

      Test that this works by calling donorStartMigration to put the database's MigratingTenantAccessBlocker into blockWrites and confirming that all writes throw TenantMigrationConflict. (After the migrationConflictRetry loop is added in SERVER-49181, this test will have to be modified to, e.g., send the writes with maxTimeMS and assert that they throw MaxTimeMSExpired.)

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: