I have a collection with around 44 million documents. I am adding new documents and at the same time deleting old ones. The deletion is currently slightly faster than the adding, so the number of documents is decreasing. I am currently down to 32 million.
Now the strange thing is that the collection's (data)size, not the storageSize is increasing all the time. With 44 million documents I had a size of roughly 3.1 TB. Now with 32 million documents the size is roughly 4 TB. The documents added and removed are more or less the same size.
Could there be a bug in mongo not updating the dataSize correctly? Somehow it is not recognising the document deletions. I understand that storageSize is not affected by document deletion, but dataSize should be. Can I somehow force mongo to recount its dataSize statistics?
As mentioned before, this question is about the actual data size. I do not care about the file size on the disk. I know that this does not shrink when I delete documents.
I am using a rather old version (2.6.10) of the mongo DB.