<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sat Jan 11 07:12:53 UTC 2025

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Mojang Studios Jira</title>
    <link>https://bugs.mojang.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en</language>    <build-info>
        <version>9.12.2</version>
        <build-number>9120002</build-number>
        <build-date>10-01-2024</build-date>
    </build-info>


<item>
            <title>[BDS-104] Save hold/resume causing world size to increase quite a bit more than normal.</title>
                <link>https://bugs.mojang.com/browse/BDS-104</link>
                <project id="11700" key="BDS">Bedrock Dedicated Server</project>
                    <description>&lt;p&gt;I have a backup script that does &quot;/save hold&quot;, backs up the world data to another directory, then does &quot;/save resume&quot;.&lt;/p&gt;

&lt;p&gt;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 &amp;amp; save the world. The size goes back down to normal.&lt;/p&gt;</description>
                <environment></environment>
        <key id="214487">BDS-104</key>
            <summary>Save hold/resume causing world size to increase quite a bit more than normal.</summary>
                <type id="1" iconUrl="https://bugs.mojang.com/secure/viewavatar?size=xsmall&amp;avatarId=18903&amp;avatarType=issuetype">Bug</type>
                                    <status id="5" iconUrl="https://bugs.mojang.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="emerysteele">emerysteele</reporter>
                        <labels>
                    </labels>
                <created>Sun, 23 Sep 2018 10:28:35 +0200</created>
                <updated>Mon, 30 Aug 2021 17:24:49 +0200</updated>
                            <resolved>Wed, 2 Jan 2019 13:57:09 +0100</resolved>
                                    <version>1.6.1.0</version>
                                    <fixVersion>1.8.0.24</fixVersion>
                                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="1064042" author="JIRAUSER681983" created="Mon, 30 Aug 2021 17:24:49 +0200"  >&lt;p&gt;cool&lt;/p&gt;</comment>
                            <comment id="504751" author="talaeus" created="Mon, 3 Dec 2018 11:11:56 +0100"  >&lt;p&gt;We found the cause of this and a fix will be available for the next update.&lt;/p&gt;</comment>
                            <comment id="498511" author="followthislogic" created="Thu, 1 Nov 2018 15:23:59 +0100"  >&lt;p&gt;Confirming this happened for me as well.&#160; I was doing this manually, not a script.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;save hold&lt;/li&gt;
	&lt;li&gt;copied world - 38MB&lt;/li&gt;
	&lt;li&gt;save resume - still 38MB&lt;/li&gt;
	&lt;li&gt;about 30 mins later.... save hold&lt;/li&gt;
	&lt;li&gt;copied world - now 125MB&lt;/li&gt;
	&lt;li&gt;save resume - still 125MB&lt;/li&gt;
	&lt;li&gt;stopped server with &quot;stop&quot;&lt;/li&gt;
	&lt;li&gt;immediately started server again (suggested above by Tomas)&lt;/li&gt;
	&lt;li&gt;world is now 39MB&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I did not give it time to see if it would reduce on its own, but I could if needed.&#160; Is there a set interval for the leveldb garbage collection? In other words, how long do I wait to see if it&apos;s behaving as expected?&lt;/p&gt;</comment>
                            <comment id="491732" author="talaeus" created="Mon, 1 Oct 2018 15:53:07 +0200"  >&lt;p&gt;What does the db folder contain? Is it lots of log-files along with the ldb files? That&apos;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?&lt;/p&gt;</comment>
                            <comment id="491479" author="emerysteele@gmail.com" created="Sat, 29 Sep 2018 07:25:27 +0200"  >&lt;p&gt;I&apos;ve done some more testing. The issue still exists when only doing &apos;save hold&apos; and &apos;save resume&apos;. No backup.&lt;/p&gt;

&lt;p&gt;I set cron to execute the &apos;save hold&apos; command every hour on the 15th minute. And &apos;save resume&apos; to run every hour on the 16th minute.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I&apos;ve also noticed that &apos;save query&apos; seems to only work once, after the first &apos;save hold&apos; command. Subsequent save queries (after save resume + save hold) do not output a response. It will work again after stopping &amp;amp; restarting, but only once.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Also tested with Windows. Seems to be working normally there. So might be isolated to the linux binary.&lt;/p&gt;</comment>
                            <comment id="491460" author="emerysteele@gmail.com" created="Sat, 29 Sep 2018 00:34:48 +0200"  >&lt;p&gt;I don&apos;t think it&apos;s the script holding up the files. It just does a simple tar job after &apos;save hold&apos;. And &apos;save resume&apos; doesn&apos;t run until the tar is finished. But I&apos;ll do some more testing with it and see what I can figure out.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;As far as I know, tar does not lock files:&#160;&lt;a href=&quot;https://unix.stackexchange.com/questions/297249/does-linux-tar-block-write-access-to-files&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://unix.stackexchange.com/questions/297249/does-linux-tar-block-write-access-to-files&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;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&apos;t have to force users off.&lt;/p&gt;</comment>
                            <comment id="491407" author="talaeus" created="Fri, 28 Sep 2018 09:21:25 +0200"  >&lt;p&gt;If that&apos;s the case then I don&apos;t understand what&apos;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&apos;s files (more or less what your Universal Minecraft Editor does).&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Could it be your script that&apos;s holding on to some file locks even after the backup is finished?&lt;/p&gt;</comment>
                            <comment id="491138" author="emerysteele@gmail.com" created="Wed, 26 Sep 2018 18:41:22 +0200"  >&lt;p&gt;Console responds with &apos;Changes to the level are resumed.&apos; Yes the following save hold command succeed.&lt;/p&gt;</comment>
                            <comment id="491059" author="talaeus" created="Wed, 26 Sep 2018 11:58:59 +0200"  >&lt;p&gt;That sounds like the `save resume` command wasn&apos;t executed properly. Does the server respond with an error to the resume command? Does the second hold command succeed?&lt;/p&gt;</comment>
                            <comment id="490972" author="emerysteele@gmail.com" created="Tue, 25 Sep 2018 18:33:39 +0200"  >&lt;p&gt;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 &amp;amp; saving. This brought the world folder size back down to ~81MB. Which I then replaced on to the server.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;</comment>
                            <comment id="490955" author="talaeus" created="Tue, 25 Sep 2018 16:22:13 +0200"  >&lt;p&gt;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&apos;t reduced automatically after a while?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_11700" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0v31z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>