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

Create TTL index on config.tenantMigrationDonors to garbage collect tenant migration donors' durable state

    • Fully Compatible
    • Sharding 2020-10-19, Sharding 2020-11-02

      On stepup, the TenantMigrationDonorService should create a TTL index on the local config.migrationDonors collection if a TTL index does not already exist on it.

      This could either be done generically in the Primary-Only Service machinery based on the Service's durable state namespace, e.g. in PrimaryOnlyServiceRegistry::onStepUpComplete, or could be done specifically for the TenantMigrationDonorService by overriding PrimaryOnlyService::onStepUp.

      This ticket can also update tests that are manually creating the TTL index right now:

      $ git grep "createIndex.*expireAt" jstests/replsets/
      jstests/replsets/tenant_migration_donor_failover_and_shutdown.js:    donorPrimary.getCollection(kConfigDonorsNS).createIndex({expireAt: 1}, {expireAfterSeconds: 0});
      jstests/replsets/tenant_migration_donor_state_machine.js:configDonorsColl.createIndex({expireAt: 1}, {expireAfterSeconds: 0});
      

      Putting this in PM-1791 to keep track of it, but it could go into PM-1810.

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

              Created:
              Updated:
              Resolved: