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

Move the tenant migration recipient MTAB lifetime earlier

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • Sharding 2021-03-22

      This is needed to close the corner case of TTL cleanup in SERVER-53768. The TTL cycle is suspended in presence of MTAB, but today MTAB is created only when the 1st clone is done. This will allow to keep the TTL logic very simple.

      Caveat, as discussed:
      "Matthew Russotto:
      If we create the mtab early we will need to make sure when we read the local database that we set the tenantMigration flag on the opCtx (we don't do that now, I don't think). The cloner needs to write; if it has that flag set when it does, its oplog writes will have the migration UUID (not sure if that's a problem, though), so if we don't want it do, we'll need to add some bits."

      "Lingzhi Deng:
      I dont think we need to worry about other writes. But I agree with Matthew that we will need to be careful with reads from the cloner, e.g. https://github.com/mongodb/mongo/blob/8cfccd21f2f06bf93345ad25b3ca0a9af489b0e2/src/mongo/db/repl/tenant_collection_cloner.cpp#L325-L357

      To do that, we could set tenantMigrationRecipientInfo(opCtx) on the opCtx and exempt that in the recipient mtab"

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: