[SERVER-37812] Compact doesn't free space Created: 30/Oct/18 Updated: 10/May/23 Resolved: 30/Nov/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | WiredTiger |
| Affects Version/s: | 4.0.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrey Kostin | Assignee: | Danny Hatcher (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
I'm using MongoDB 4.0.3 with WiredTiger engine in LXD container over ZFS filesystem.
As you can see, DB didn't release unneeded space. |
| Comments |
| Comment by Danny Hatcher (Inactive) [ 30/Nov/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello Andrey, As we've heard nothing back from you, I will now close this ticket. Thank you, Danny | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Danny Hatcher (Inactive) [ 14/Nov/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello Andrey, Can you please upload the mongod logs and the diagnostic.data folders from all three nodes to our Uploader via the following link? https://10gen-httpsupload.s3.amazonaws.com/upload_forms/e90ca8ad-1026-44a8-a833-4db316736a54.html Thank you, Danny | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrey Kostin [ 08/Nov/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This collection was created a long time ago. I'm not sure about version I used at that moment but it was one of 3.2 - 3.6. I have: Collection was successfully compacted on replica node. Then I tried 3 times to do the same with desktop and no success. After that I put master node in secondary state with stepDown and started compact operation which also didn't succeed. Right now I can only reproduce this issue using master node since at desktop I reduced the size of the storage using mongodump/mongorestore. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Danny Hatcher (Inactive) [ 07/Nov/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello Andrey, You mention that this is on MongoDB 4.0.3. Was this collection created while you were on 4.0.3 or was the collection created while you were on a different version (and what version would that be)? Do you have any way to reproduce this issue in a consistent manner? Could you please explain in more detail as to how you are using GridFS to insert, edit, and delete your data? Thank you, Danny | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrey Kostin [ 07/Nov/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I have 1059GB of free space available for mongod instance. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Danny Hatcher (Inactive) [ 06/Nov/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello Andrey, Because you are using GridFS to store blobs of data, it is very possible that WiredTiger needs to reserve that much space on disk. When you run db.fs.chunks.stats(), what is the value under the heading wiredTiger.block-manager.file bytes available for reuse? If the number there is 0 or very low, then compact will most likely not have any effect on reducing the storage space on your system. Please provide the output of the full db.fs.chunks.stats() command so that we can see if anything else stands out. Please note that unless you have recently removed a large amount of data from your system, it is not likely that you will see a large reduction of storage used by running the compact command. Thank you, Danny | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrey Kostin [ 31/Oct/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrey Kostin [ 30/Oct/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If you take a look at db.stats() results you'll see that I have 169GB of data in 458GB storage. There are only 2 collections in this DB, fs.chunks (~166GB) and fs.files (~3GB). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 30/Oct/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
lisio, this is not unexpected behavior, depending on the circumstances; the documentation says:
If you didn't remove large amounts of data from fs.chunks the compact will not reclaim any unused disk space because there may not be any no reclaim. If there's a way you can reproduce this issue reliably and you believe there's a bug, will you please share the reproducer so we can investigate? Thanks, |