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

Don't skip checkpoint if the file can be truncated

    • Storage Engines
    • 8
    • 2024-08-06 - Withholding Tax, StorEng - 2024-09-17, 2024-09-03 Q3 Streams v1, StorEng - 2024-10-01, StorEng - 2024-10-15, StorEng - 2024-10-29, StorEng - 2024-11-12, StorEng - 2024-11-26

      Even after the collection is completely empty due a TTL index the disk space is not released to the OS.

      Following the steps for the repro tested on 8.0.0-rc13 and MacOS 14.5:

      // start single node replica set 
      // mlaunch init --replicaset --node 1
      
      function makeid(length) {
          let result = '';
          const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
          const charactersLength = characters.length;
          let counter = 0;
          while (counter < length) {
            result += characters.charAt(Math.floor(Math.random() * charactersLength));
            counter += 1;
          }
          return result;
      }
      // generate random string
      let r = makeid(5000)
      
      for(i=0;i<20000;i++){db.foo.insertOne({r:r, a:ISODate('2023-07-29T11:17:56.215Z')})}
      db.foo.aggregate([{$limit: 20000},{$set: {range: {$range: [0,100]}}},{$unwind: "$range"},{$project: {_id:0, range:0}},{$merge: "foo"}])
      
      // replset [direct: primary] test> db.foo.stats(1024*1024).storageSize
      // 10458.5703125
      
      // create ttl index 
      db.foo.createIndex({a:1},{expireAfterSeconds: 3600 })
      
      
      // replset [direct: primary] test> db.foo.stats(1024*1024).indexSizes
      // { _id_: 145.9453125, a_1: 77.34765625 }
      // replset [direct: primary] test> db.foo.stats(1024*1024).storageSize
      // 16110.84375
      

        1. diag.tar.gz
          3.43 MB
          Sulabh Mahajan
        2. reproducer.py
          2 kB
          Etienne Petrel
        3. Screenshot 2024-07-30 at 3.33.43 PM.png
          301 kB
          Sulabh Mahajan
        4. Screenshot 2024-07-30 at 3.35.07 PM.png
          287 kB
          Sulabh Mahajan
        5. Screenshot 2024-07-30 at 3.36.59 PM.png
          301 kB
          Sulabh Mahajan
        6. Screenshot 2024-07-31 at 3.22.05 PM.png
          125 kB
          Sean Watt
        7. Screenshot 2024-07-31 at 3.22.16 PM.png
          43 kB
          Sean Watt
        8. Screenshot 2024-07-31 at 3.22.21 PM.png
          40 kB
          Sean Watt
        9. Screenshot 2024-07-31 at 3.22.24 PM.png
          39 kB
          Sean Watt
        10. Screenshot 2024-08-01 at 5.39.22 PM.png
          119 kB
          Sean Watt
        11. Screenshot 2024-08-01 at 5.39.49 PM.png
          62 kB
          Sean Watt
        12. wt-13340.js
          2 kB
          Sean Watt

            Assignee:
            sean.watt@mongodb.com Sean Watt
            Reporter:
            renato.riccio@mongodb.com Renato Riccio
            Chenhao Qu, Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: