[SERVER-9489] Recreating a dropped capped collection allocates more physical space Created: 27/Apr/13 Updated: 27/Jan/17 Resolved: 05/Dec/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | 2.4.2 |
| Fix Version/s: | 2.5.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Asya Kamsky | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 4 |
| Labels: | mmapv1 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
After dropping capped collection of certain size, I would expect recreating it to reuse the space but dropping a 5GB capped collection and then recreating it always allocates two new physical 2GB db.x files.
Looking in my /data/db after each new drop followed by create I have a new file for that DB:
Here is a repeat showing two more files and times of creation to the second:
|
| Comments |
| Comment by Ramon Fernandez Marina [ 05/Dec/14 ] | ||||||||||||||||||||||||||
|
This issue no longer reproduces on 2.6.5 or 2.8.0-rc0. Will find the exact release when it was fixed and resolve. | ||||||||||||||||||||||||||
| Comment by mongoler [ 18/Jul/13 ] | ||||||||||||||||||||||||||
|
any one have idea to deal this problem temporary? | ||||||||||||||||||||||||||
| Comment by Pawe? Stawicki [ 03/Jun/13 ] | ||||||||||||||||||||||||||
|
db.coll.stats look OK. Here it is (notice 1024*1024 - values in megabytes):
| ||||||||||||||||||||||||||
| Comment by Scott Hernandez (Inactive) [ 03/Jun/13 ] | ||||||||||||||||||||||||||
|
Pawel, can you provide db.coll.stats() please? | ||||||||||||||||||||||||||
| Comment by adamw [ 30/Apr/13 ] | ||||||||||||||||||||||||||
|
But why would the indexes grow (indefinitely?), if the documents are removed because of the cap? | ||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 30/Apr/13 ] | ||||||||||||||||||||||||||
|
Pawel: it's possible that the new files are allocated for the growing indexes in your case. | ||||||||||||||||||||||||||
| Comment by Pawe? Stawicki [ 29/Apr/13 ] | ||||||||||||||||||||||||||
|
It's slightly different than the problem I have. Here collection is dropped, while I was inserting documents to mine, so that it hit the cap and should not grow anymore, but it still was creating new files and using more disk space. I believe it's caused by the same bug, can you confirm? | ||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 28/Apr/13 ] | ||||||||||||||||||||||||||
|
js test that creates a 2GB capped collection, drops it, then creates it again and compares db.stats - 2.2 and 2.4 both increase file size from 4GB after first capped collection is created to 6GB |