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

XMLWordPrintableJSON

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

      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
            Reporter:
            Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: