mojira.dev
MC-35493

Server loses player files of active players (player.dat) when it doesn't get properly closed

I am hosting a server, and due to a problem with my mass-storage drive (cable of the drive got disconnected, windows and the minecraft server where on my primary drive which was just fine) which caused windows to crash, so I had to press my power button.

The player data of the players which were playing on my server during the crash was completely removed (player.dat files of those players where missing in the map-data), playerdata of the other players was fine and map was slightly rolled back (becouse mapdata wasn't saved before te server shut down)

Rolled 1 hour back, and after a litttle wile I got the same problem. And lost the playerdata of the active players again.

Player data of the non-active players was both times just fine.

What I expected to happen was...:
Mapdata/playerdata should be slightly rolebacked, becouse it wasn't saved properly.

What actually happened was...:
Mapdata was fine, but the playerdata of the player which was playing on the server, during the crash got removed. The playerdata of the other players was fine.

Steps to Reproduce:
1. Run a Minecraft server on 1.6.4
2. Log in on the server with at least 1 player
3. Make sure that the playerdata gets saved on your drive before going to step 4
4. Turn of your computer withoud giving the server a change to autosave
5. Now, the playerdata of the players playing on the server during the crash is lost, other playerdata is fine

Attachments

Comments 2

I don't know what you expect to have done about this. File loss during a system crash will happen usually due to filesystem errors (the files are open and being used at the time of the crash).

Yes, but they should not be completely deleted, after the crash they don't exist anymore in the worlddata. And that happens every time, and the worlddata is just fine every time.

For instance, it would be better to read the files one time when the server is started, saving the data on the RAM, and writing it back in the map data every minute.
It would cause a lagg spike if you would write all the playerdata files at the same time, but you could also write every playerdata file seperetely with a little delay between that.
This would minimise the change of file loss during a system crash, and would not cause all the files to be simply deleted.

Another solution would be to sort of back up the playerdatafiles every hour, so a systemcrash would cause just a small rollback with the playerfiles.

Thijs Lacquet

(Unassigned)

Unconfirmed

playerdata, saved, server

Minecraft 1.6.4

Retrieved