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

Oplog visibility rules can cause cappedTruncateAfter to erroneously skip record deletion in WiredTiger

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.5, 3.7.4
    • Affects Version/s: None
    • Component/s: Replication, Storage
    • None
    • Fully Compatible
    • ALL
    • v3.6
    • 0

      The WiredTigerRecordStore::cappedTruncateAfter method truncates a capped collection after a given RecordId. For a non-inclusive truncation, it first establishes a forward scanning cursor on the collection and then iterates forward to the record immediately succeeding the given truncation point. If no next record is found it will return and not execute the capped truncation. This can be a problem when truncating the oplog collection, since the forward scanning record store cursor will be bound to oplog visibility rules, and if the oplog read timestamp has not been updated yet to the newest timestamp, this cursor may erroneously be exhausted before reaching the end of the oplog, making it seem like the oplog has less entries than it actually does. This can cause the oplog to not properly be truncated after a call to cappedTruncateAfter.

            Assignee:
            william.schultz@mongodb.com William Schultz
            Reporter:
            william.schultz@mongodb.com William Schultz
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: