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

Capped collection truncation behavior across storage engines is inconsistent

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.8.0-rc4
    • Fix Version/s: 2.8.0-rc5
    • Component/s: Storage
    • Labels:
    • Backwards Compatibility:
      Fully Compatible

      Description

      Looking at these two lines of source in WT and MMapV1:

      WT: https://github.com/mongodb/mongo/blob/r2.8.0-rc4/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp#L353
      MMapV1: https://github.com/mongodb/mongo/blob/r2.8.0-rc4/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp#L403

      Note that in WT a '>' is used and in MMapV1 a '>=' is used. Given a capped collection of size 100, if we insert two documents of size 50 and then truncation occurs:

      • in MMapV1, one document will get deleted because its position would be >= 100
      • in WT no documents would be deleted because the size would not be > 100.

      These two behaviors should be made the same, likely in favor of the existing MMapV1 behavior.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jonathan.balsano Jonathan Balsano
              Reporter:
              jonathan.balsano Jonathan Balsano
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: