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

WT only reclaiming diskspace after 2nd compact

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.3.1
    • Component/s: WiredTiger
    • None
    • ALL
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      If I move the assert after a second call to compact, the test succeeds.

      db.a.drop();
      for(i=0;i<25000;i++) { db.a.insert({x:i, y:"asdfasdfasdfasdfasdfasdfasdfasdfasdf"}); }
      db.adminCommand('fsync'); // force checkpoint
      var collectionSize = db.a.stats().storageSize;
      print("coll size: " + collectionSize);
      
      print("Remove all docs...");
      db.a.remove({});
      db.adminCommand('fsync'); // force checkpoint
      print("table size: " + db.a.stats().storageSize);
      
      print("Run 1st compact...");
      db.a.runCommand('compact');
      db.adminCommand('fsync'); // force checkpoint
      print("table size: " + db.a.stats().storageSize);
      
      assert.gt(collectionSize, db.a.stats().storageSize, "collection size should be smaller after compact");
      

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: