MommyHeather / AdvancedBackups

BSD 3-Clause "New" or "Revised" License
21 stars 5 forks source link

Differential backups not working #33

Closed imagelesskink closed 8 months ago

imagelesskink commented 9 months ago

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):

MommyHeather commented 9 months ago
imagelesskink commented 9 months ago
MommyHeather commented 9 months ago

Hmm.

imagelesskink commented 8 months ago
MommyHeather commented 8 months ago

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

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...

MommyHeather commented 8 months ago

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!

MommyHeather commented 8 months ago

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.

MommyHeather commented 8 months ago

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

It's pending approval on curseforge.