Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54478

Recipient primary failover after forget migration can lead to the oplog buffer collection not being dropped on new primary

    • 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.

            Assignee:
            vishnu.kaushik@mongodb.com Vishnu Kaushik
            Reporter:
            vishnu.kaushik@mongodb.com Vishnu Kaushik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: