[BDS-104] Save hold/resume causing world size to increase quite a bit more than normal. Created: 23/Sep/18 Updated: 30/Aug/21 Resolved: 02/Jan/19 |
|
| Status: | Resolved |
| Project: | Bedrock Dedicated Server |
| Affects Version/s: | 1.6.1.0 |
| Fix Version/s: | 1.8.0.24 |
| Type: | Bug | ||
| Reporter: | emerysteele | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I have a backup script that does "/save hold", backs up the world data to another directory, then does "/save resume". It seems every time I do this, the world folder size grows by about 30%. It seems like it is not getting rid of old, not needed ldb files. When I open the world in Universal Minecraft Editor & save the world. The size goes back down to normal. |
| Comments |
| Comment by hamid hamidou [ 30/Aug/21 ] |
|
cool |
| Comment by [Mojang] Tomas Alaeus [ 03/Dec/18 ] |
|
We found the cause of this and a fix will be available for the next update. |
| Comment by FollowThisLogic [ 01/Nov/18 ] |
|
Confirming this happened for me as well. I was doing this manually, not a script.
I did not give it time to see if it would reduce on its own, but I could if needed. Is there a set interval for the leveldb garbage collection? In other words, how long do I wait to see if it's behaving as expected? |
| Comment by [Mojang] Tomas Alaeus [ 01/Oct/18 ] |
|
What does the db folder contain? Is it lots of log-files along with the ldb files? That's how it should look if the backup command is permanent on, because leveldb is told not to delete any files. Maybe the log files are only kept from the time where the backup is active? |
| Comment by emerysteele [ 29/Sep/18 ] |
|
I've done some more testing. The issue still exists when only doing 'save hold' and 'save resume'. No backup. I set cron to execute the 'save hold' command every hour on the 15th minute. And 'save resume' to run every hour on the 16th minute. After about 4-5 hours my world folder size is now 2044844KB (2.044844GB). So it must be something broken with the save system. This is up from 109MB of the original size.
I've also noticed that 'save query' seems to only work once, after the first 'save hold' command. Subsequent save queries (after save resume + save hold) do not output a response. It will work again after stopping & restarting, but only once.
Also tested with Windows. Seems to be working normally there. So might be isolated to the linux binary. |
| Comment by emerysteele [ 28/Sep/18 ] |
|
I don't think it's the script holding up the files. It just does a simple tar job after 'save hold'. And 'save resume' doesn't run until the tar is finished. But I'll do some more testing with it and see what I can figure out.
As far as I know, tar does not lock files: https://unix.stackexchange.com/questions/297249/does-linux-tar-block-write-access-to-files
I have confirmed though that stop/start does make leveldb do a garbage collection. But if I can resolve without having to restart the server that would be ideal, so I don't have to force users off. |
| Comment by [Mojang] Tomas Alaeus [ 28/Sep/18 ] |
|
If that's the case then I don't understand what's going on... When the world has grown really large, try to restart the server. That usually makes leveldb do a garbage collection and clean up it's files (more or less what your Universal Minecraft Editor does).
Could it be your script that's holding on to some file locks even after the backup is finished? |
| Comment by emerysteele [ 26/Sep/18 ] |
|
Console responds with 'Changes to the level are resumed.' Yes the following save hold command succeed. |
| Comment by [Mojang] Tomas Alaeus [ 26/Sep/18 ] |
|
That sounds like the `save resume` command wasn't executed properly. Does the server respond with an error to the resume command? Does the second hold command succeed? |
| Comment by emerysteele [ 25/Sep/18 ] |
|
I only let it run for about a day. After running the script every 2 hours for about a day, the world folder size was about 2.5GB. I ended up downloading the data, opening the world with Universal Minecraft Editor & saving. This brought the world folder size back down to ~81MB. Which I then replaced on to the server. I had to modify the script to stop the minecraft server, backup, then start the server again to get around the folder size increase issue. |
| Comment by [Mojang] Tomas Alaeus [ 25/Sep/18 ] |
|
The old files will get cleaned up eventually when leveldb figures out that it can remove them. Are you saying that the extra size isn't reduced automatically after a while? |