[SERVER-48941] [recovery] Make startup recovery recover a tenant migration donor's in-memory state Created: 18/Jun/20  Updated: 29/Oct/23  Resolved: 18/Sep/20

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

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

Issue Links:
Depends
is depended on by SERVER-50466 [stepup] Test that a new replica set ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-09-21
Participants:

 Description   

This ticket is to make mongod recover on startup which database prefixes to block/reject operations for.

  • Add a function void recoverTenantMigrationAccessBlockers(OperationContext* opCtx) to migrating_tenant_donor_util.cpp that scans config.migrationDonors (see example), and for each doc:
    • Creates a TenantMigrationAccessBlocker for that “databasePrefix” and add()'s it to TenantMigrationAccessBlockerByPrefix
    • If the doc has "blockTimestamp" set, call startBlockingWrites() and then startBlockingReadsAfter() with the “blockTimestamp” on the TenantMigrationAccessBlocker
    • If the doc's state is “commit” , also call commit() on the TenantMigrationAccessBlocker
    • If the doc's state is “abort” , also call abort() on the TenantMigrationAccessBlocker
  • Call the new recoverTenantMigrationAccessBlockers function just before where prepared transactions are recovered on startup

This ticket should also test that the code works by restarting the donor

  • while the migration is in the "blocking" state
  • after the migration has committed
  • after the migration has aborted

and confirming that the in-memory state was recovered correctly. See tenant_migration_donor_state_machine.js for an example of pausing a migration while it's blocking and checking the donor's in-memory state.



 Comments   
Comment by Githook User [ 18/Sep/20 ]

Author:

{'name': 'Jason Zhang', 'email': 'jason.zhang@mongodb.com', 'username': 'jz1242'}

Message: SERVER-48941 Make startup recovery recover a tenant migration donor's in-memory state
Branch: master
https://github.com/mongodb/mongo/commit/7689c2c8eeb1ea118ce12c544befef31c2bafa67

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