Advanced Backups

Advanced Backups

1M Downloads

Differential backups not working

imagelesskink opened this issue ยท 8 comments

commented

Describe the bug
No matter which version of the differential backups I restore, it always go back to the full backup.

To Reproduce
Steps to reproduce the behavior:

  1. Unzip full backup into server world folder
  2. Unzip partial backup
  3. Start the server and join in
  4. Multiple days of work disappear into thin air

Expected behavior
Turn back time for just an hour or so

Versioning (please complete the following information):

  • OS: whatever the Kinetic Hosting servers use
  • Minecraft Version(s): 1.20.1
  • Modloader(s): Fabric
  • Mod Version: 3.0.1
commented
  • Does the same happen when restoring through the commandline tool?
  • Which version were the backups made in?
  • Could you attach your config?
commented
  • It happened twice. The first time it was around a day, the second a little over two days.
  • The server did restart. My server sometimes botches up the save when restarting, so that's my main use for this mod.
commented
commented

Hmm.

  • How far apart were the two backups made?
  • Did the server restart at all during that time?
commented

Hmm. I seem to have narrowed it down to some vanilla behaviour :

  • Run a server, do some things on it.

  • Run /save-all and notice that despite it saying things were saved, the files on disk have not changed.

  • Let an autosave happen and notice that the same thing happens.

  • Run /save-all flush and observe a lag spike. The files on disk do change here.

I was consistently able to reproduce this across forge, fabric and pure-vanilla, similar behaviour on client, and across multiple minecraft versions.

save-all, myself and other backup mods all make the same calls to vanilla methods.
Advanced Backups used to force a flush, but due to complaints of sometimes server-crashing lag spikes this was removed.
I have checked some other backup mods and those I checked also don't force a flush...

As such, this leaves me a bit uncertain as to how to proceed...
I think a config option for flush is the best idea - but I'm still concerned by your report of server sometimes botches up the save when restarting...

commented

Okay, after some further investigation - I've noticed that the attribute showing when the file was last updated doesn't change, but the hash does change every single tick where the respective file would be open.

This explains why zip and other mods seem unaffected - as those do not check file dates, they just copy the entire world state.

I'll fix this by using hashes to check which files backup - it can result in some extra bulk, but imo this is a perfectly good tradeoff.

Thanks for the report!

commented

#34 is all tested and ready to merge at this point. I'll implement that config and aim for a release either tonight or early tomorrow.

Closing this issue as a result - feel free to re-open if you have any further issues.

commented

Figured I'd alert you that this is now out on Modrinth @imagelesskink

It's pending approval on curseforge.