Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-10307

Enable point in time truncate functionality for MongoDB

    • Storage Engines
    • 5
    • 2023-03-21 Ellen Ripley, 2024-03-19 - PacificOcean, 2024-04-02 - GreatMugshot, 나비 (nabi) - 2024-04-16

      WiredTiger introduced the ability to correctly execute a WT_SESSION::truncate operation with an application supplied timestamp to the standalone release of WiredTiger in WT-8447. That fix required an on-disk data format change, so for MongoDB we added support for reading the new data format, but did not yet support writing the additional information.

      That restriction was in place to ensure that users could downgrade without issue from the current (6.0) version of MongoDB to an earlier version.

      The scope of this ticket is to enable writing the information required to correctly support a truncate operation at a timestamp in MongoDB. That will be done by reviewing the code the is excluded via HAVE_STANDALONE_RELEASE define, which is how the functionality is restricted.

      The other work required prior to completing this will be to ensure that the following works:

      • Application performs a truncate at a point in time with WiredTiger that supports timestamp safe truncate.
      • Artificially crash application before a new checkpoint is created.
      • Startup the database using an older version that doesn't support point-in-time semantics.

      It might be sensible to split that testing work into a different ticket and get it done prior to this ticket that enables the functionality for MongoDB.

      It's also worth noting that if a truncate at a point in time is done, then the application is downgraded, it is not guaranteed that WiredTiger recovery will exhibit the correct behavior. The value of the additional persisted information is that it allows recovery to make the right decision about how to re-apply a truncate operation during recovery.

      That should be OK for MongoDB - since recovery as-of a timestamp isn't WAL based, so shouldn't encounter a problematic scenario. There are a number of suppositions there though - which is why testing is important to increase confidence.

        1. skip_level_downgrade.js
          3 kB
          Suganthi Mani

            Assignee:
            monica.ng@mongodb.com Monica Ng
            Reporter:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: