espidev / ebackup

An easy and reliable plugin for backups on Spigot servers! Supports SFTP!
https://www.spigotmc.org/resources/ebackup-simple-and-reliable-backups-for-your-server-supports-ftp-sftp.69917/
GNU General Public License v3.0
54 stars 16 forks source link

Possible to add a config option to disable the built-in world save? #50

Open jmattingley23 opened 1 year ago

jmattingley23 commented 1 year ago

I've noticed this plugin triggers it's own world save just before creating a backup, which seems logical but doesn't feel ideal for performance when running something like PaperMC, since this plugin and Paper (or Spigot, Bukkit, etc) will be running competing autosave schedules.

One option could be to just disable the PaperMC autosave and rely on the one from eBackup, but I would probably prefer to use the Paper one since it implements an incremental worldsave strategy where the chunk saving process is spread out over many server ticks to lessen the performance hit, and recommends against saving via any plugins or by manually invoking /save-all. Here's the warning from the spigot logs every time the backup runs:

[15:45:00] [Craft Scheduler Thread - 6 - eBackup/INFO]: [eBackup] Starting backup...
[15:45:02] [Server thread/WARN]: A manual (plugin-induced) save has been detected while server is configured to auto-save. This may affect performance.

Would it be feasible to add an option to disable the plugin autosave? I see here you still disable the autosave while the actual compression is taking place, so I'm hoping that removing the preceding save would still be safe. My thinking is that this shouldn't cause any corruption but would just come at the cost of accepting that the actual world files backed up may sometimes be slightly older than the filename implies since the server autosave would not be perfectly in-step.

Curious to hear your thoughts since you've probably done a lot of testing on this. Thanks!

espidev commented 1 year ago

Yes, as long as the code is able to check and make sure no saves are running at the time of the backup.

EDIT: in regular circumstances, saves would freeze the server and so it likely wouldn't be possible for a backup to happen during a save, i'm not sure if paper acts differently in this case with the feature you describe