Selective PIT restore creates collections/views that were not selected for backup if they are created after the checkpoint timestamp

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 7.0.0, 8.0.0, 8.3.0-rc0, 8.2.0, 9.0.0-rc0
    • Component/s: None
    • None
    • Storage Engines - Server Integration
    • ALL
    • SESINEXT- 2026-04-21
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Context: Selective point-in-time backup/restore follows this high-level flow:

      1. Backup:
        1. Create a consistent snapshot at checkpoint timestamp Tbackup.
        2. Copy the data files for the selected collections at Tbackup.
        3. Capture the entire oplog starting at Tbackup (non-selective).
      2. Restore at point in time Trestore.
        1. Restore the data files for the selected collections (at Tbackup state).
        2. Replay all the oplog from Tbackup to Trestore (non-selective).

       

      Both oplog capture and replay are non-selective, and instead rely on trying to apply the oplog entry and if it fails to apply because the namespace doesn't exist then we ignore the error. (see also: SERVER-62615).

       

      The issue: Since both (1.3) and (2.2) are non selective, any new collections or views are created after Tbackup end up in the final restored cluster. For example consider:

      • A replica set has collections a, b, c and d.
      • The user selects to only backup collections a and b.
      • After Tbackup, a new collection e is created.
      • The user starts restoring the backup. This initially creates collections a and b.
      • During application of the oplog, entries for collections c and d become no-ops.
      • However the oplog entry to create new collection e is still applied successfully.
      • As a result the restored replica set has collections a, b and e (despite the user selecting only a and b).

       

      It seems that during selective restore we should skip the oplog entries to create new collections/views.

            Assignee:
            Unassigned
            Reporter:
            Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: