-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Fully Compatible
-
ALL
-
Repl 2021-02-22
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.