mojira.dev
MC-78635

Stopping a server after save-off causes unexpected data loss

Stopping a Minecraft server with the command /stop after the /save-off command has been executed cause the outstanding changes to the world to be discarded.

This can cause an unexpected and unrecoverable loss of data spanning anything from hours to weeks upon shutting down a server.

In combination with MC-3208 this behavior causes the world state to become corrupt in addition to the data loss.

Steps to reproduce

  1. Start a Minecraft server

  2. Execute /save-off

  3. Make changes to the world. (i.e, place some blocks)

  4. Stop the server with /stop, and start it up again

  5. Observe that the changes made has been discarded

Expected behavior

When stopping, the Minecraft server would save the world to disk, regardless of state of save-on/save-off.

What actually happened

The changes to the world was discarded.

Comments 9

WAI (Works As Intended).

The /save-off command is used to disable the server writing to the world file. All changes made after that command is used are temporarily queued until the server is closed / stopped, like how RAM works.

The server is exactly doing what's been told.
Don't expect it to do an internally issued save-on when issuing stop.

Your comments contradict each other. Which one is it?

The reason I think this is unintended behavior and therefor a bug is that this causes unexpected loss of data, and it's not documented anywhere. The Minecraft wiki entry for stop reads as follows.

Saves all changes to disk, then shuts down the server.

If this truly is intended behavior, then this goes against what I expect to happen, what the person who wrote that expect happens when /stop is issued, and how Sonic explains how /save-off works. In addition this behavior is severely bugged and causes the world to be left in an inconsistent state.

If you add a chest with a stack of diamonds in it between step 1 and step 2. Then in step 3, you take out the stack of diamond from the chest, you will observer in step 5 that you have two stacks of diamonds. Conversely, if you instead put in a stack of diamonds in step 3, then that is lost in step 5.

Both comments, actually.

Also, the Minecraft Wiki usually isn't considered a reliable source for bug reports.

All changes made after that command is used are temporarily queued until the server is closed / stopped, like how RAM works.

Outstanding changes in RAM is either saved or asks me to save it when I shut down my computer. If I unplug my computer, those changes are lost. In Minecraft with save-off, outstanding changes are discarded when I shut down the server, it's also discarded when I kill it. Either your analogy is bad, or it's not working as intended according to you.

In the case of this being intended behaviour, it's still bad. It cause data loss, contradicts expected behaviour, isn't documented anywhere, and it leaves the world in an inconsistent state.

Thank you. Sorry for being a bit edgy, this bug almost made me lose several hours of game play on a server I manage, Good backup routines saved the day, though I'm going to be very careful about save-off in the future.

Save-off is the ENTIRE setting for saving for minecraft. /stop checks /save-off before it saves the world, if you ran the command /save-off, it will not save the world.

Contrary to what the issue state suggests, as of 1.10.2, this problem is not fixed or it is in regression.
Since the fix version is a 1.9 snapshot, I think a mistake was made.

We just lost about a week of game play on our server because of it.
This almost dissolved our group.

This was before we added a backup system.
Btw, I notice that most backup tools do something like save-off && save-all && create archive && save-on.
If the server is /stopped during the "create archive" phase, all changes since the save-all will be lost.
If the backup takes a while, this could mean losing many changes.

Please make /stop save the map unconditionally.
That is the behaviour everyone expects until they figure it out the hard way.

EDIT: I just remembered the server got a SIGTERM, not a /stop.
Maybe there is a difference, but I doubt so.

Julian Sivertsen

michael

Unconfirmed

Minecraft 1.8.1, Minecraft 1.8.3

Minecraft 15w46a

Retrieved