We have space problems. The actual data size is only 5 GB, but disk size is 15 GB because of deleted documents. MongoDB (3.0.6) runs in docker container where we can't extend volume.
# tail -f mongod.log
2016-04-26T14:43:59.631+0000 I STORAGE [FileAllocator] allocating new datafile /data/work/mongodb/data/opWNFbyNlGQ6xShT.11, filling with zeroes...
2016-04-26T14:43:59.632+0000 I STORAGE [FileAllocator] FileAllocator: posix_fallocate failed: errno:28 No space left on device falling back
2016-04-26T14:43:59.632+0000 I STORAGE [FileAllocator] error: failed to allocate new file: /data/work/mongodb/data/opWNFbyNlGQ6xShT.11 size: 2146435072 failure creating new datafile; lseek failed for fd 40 with errno: errno:2 No s^C
disk
/dev/vdh 16G 15G 553M 97% /data/a6a186a3-dc98-4f47-83f3-96e953c18b69
repairDatabase doesn't work because no scratch space
> db.runCommand( { repairDatabase: 1 } );
{
"ok" : 0,
"errmsg" : "Cannot repair database opWNFbyNlGQ6xShT having size: 14975762432 (bytes) because free disk space is: 578928640 (bytes)",
"code" : 14031
}
So I tried
> db.runCommand ( { compact: 'accounts', paddingFactor: 1.1 } )
{ "ok" : 1 }
I don't see nothing in progress
> db.currentOp()
{ "inprog" : [ ] }
> db.currentOp()
{ "inprog" : [ ] }
> db.currentOp()
{ "inprog" : [ ] }
There is no entry in mongodb.log about the compact operation
You may view the intermediate progress either by viewing the mongod log file or by running the db.currentOp() in another shell instance.
Why compact fails?
is our only solution to do dump/drop/restore?