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

Compact does not free space

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

      MongoDB three-node replica set, version v4.4.5.

      I removed some data in the collection on the PRIMARY node, and then I executed the compact command on the SECONDARY node, but the freeStorageSize was not released after execution, why?

       

      local-mongodb-one:SECONDARY> db.test_catch.stats()
      {
              "ns" : "mdworkflow.test_catch",
              "size" : NumberLong("5555713675259"),
              "count" : 18994123,
              "avgObjSize" : 292496,
              "storageSize" : 811467612160,
              "freeStorageSize" : 30761287680,
              "capped" : false
      }
      local-mongodb-one:SECONDARY> db.runCommand({ compact:"test_catch" } )
      { "bytesFreed" : 0, "ok" : 1 }
      local-mongodb-one:SECONDARY> db.test_catch.stats()
      {
              "ns" : "mdworkflow.test_catch",
              "size" : NumberLong("5555714175181"),
              "count" : 18994126,
              "avgObjSize" : 292496,
              "storageSize" : 811467612160,
              "freeStorageSize" : 30761205760,
              "capped" : false
      } 

            Assignee:
            yuan.fang@mongodb.com Yuan Fang
            Reporter:
            wuyanfeiwork@gmail.com Yanfei Wu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: