[SERVER-50191] Create TTL index on config.tenantMigrationDonors to garbage collect tenant migration donors' durable state Created: 08/Aug/20  Updated: 29/Oct/23  Resolved: 20/Oct/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: pm-1791_milestone-A
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-50406 Add hook for PrimaryOnlyServices to b... Closed
is depended on by SERVER-49204 Implement donorForgetMigration command Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-10-19, Sharding 2020-11-02
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 20/Oct/20 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-50191 Create TTL index on config.tenantMigrationDonors to garbage collect tenant migration donors' durable state
Branch: master
https://github.com/mongodb/mongo/commit/5c1f6a0a78ad31f5cd098a50693f1f60fb2c473d

Comment by Esha Maharishi (Inactive) [ 08/Aug/20 ]

CC cheahuychou.mao , spencer

Generated at Thu Feb 08 05:22:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.