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

Backup cursor service reports incorrect 'ns' field in the backup cursor response.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • Fully Compatible
    • ALL
    • Execution Team 2024-01-08, Execution Team 2024-01-22, Execution Team 2024-02-05
    • 6

      It's a bug in mongodb code, particularly this part of the code. Basically, we don't use this mdb_catalog checkpoint cursor that was opened prior to the backup cursor open; instead, we use a different  mdb_catalog  checkpoint cursor ( getParsedCatalogEntry() opens a new checkpoint cursor), opened after the backup cursor open, to fill in the 'ns' field in the backup cursor response . This means that if a checkpoint occurred after this BackupCursorOpenConflictWithCheckpoint check, the alternate checkpoint cursor might be operating on a different snapshot than the backup cursor, potentially resulting in incorrect 'ns' information in the backup cursor response.

      As a result, this causes selective_backup_restore_e2e.js to inadvertently skip copying files that's actually part of backup snapshot, resulting in the restore node crash due to missing files.

      =================
      Some code improvements were identified during the BF investigation.

      1) "BackupCursorOpenConflictWithCheckpoint" check currently performs two checks, namely "LastStableRecoveryTimestamp" and "checkpoint id." It would be beneficial to either enhance the error message or add a debug log message to specify which check failed and provide details about the mismatched checkpoint and recovery timestamp.

      2) Use ReadSourceScope RAII instead of explicitly setting the TimestampReadSource here and here for better readability. Also, the RAII make sure we abandon the snapshot before we explicitly setting the TimestampReadSource in the recovery unit.

            Assignee:
            wei.hu@mongodb.com Wei Hu
            Reporter:
            suganthi.mani@mongodb.com Suganthi Mani
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: