[SERVER-54478] Recipient primary failover after forget migration can lead to the oplog buffer collection not being dropped on new primary Created: 11/Feb/21  Updated: 29/Oct/23  Resolved: 16/Feb/21

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

Type: Bug Priority: Major - P3
Reporter: Vishnu Kaushik Assignee: Vishnu Kaushik
Resolution: Fixed Votes: 0
Labels: pm-1791_milestone-B
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2021-02-22
Participants:

 Description   

Start a tenant migration, with a two node recipient replica set. After the migration has completed, issue a forgetMigration command, and step down the recipient primary after it has marked the state doc as garbage collectable but before it has dropped the oplog, basically around here.

The new recipient primary will notice that the document is already marked as garbage collectable, and will jump to the first onCompletion block. This block will call _cleanupOnDataSyncCompletion and fulfill the _stateDocPersistedPromise with the error status.

Then, it will proceed to _markStateDocumentAsGarbageCollectable, and then throw here, stating that the document has already been marked (the promise was fulfilled with the error status earlier). Thus, the remaining portion of the chain will be skipped, and the new primary will end up NOT dropping the oplog buffer collection.



 Comments   
Comment by Githook User [ 16/Feb/21 ]

Author:

{'name': 'Vishnu Kaushik', 'email': 'vishnu.kaushik@mongodb.com', 'username': 'kauboy26'}

Message: SERVER-54478 Fix issue where recipient primary failover after forget migration can lead to the oplog buffer collection not being dropped on new primary
Branch: master
https://github.com/mongodb/mongo/commit/09c474af1cca7c54d3f93ac46d8fbe9549cd4689

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