-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] More advanced backup / trimming options #37
Comments
The first item is something I can put on the backlog for sure. Good opportunity to hook into the ‘list’ command as well to ensure that we know how many players are logged in when the service starts (just in case the two containers are not started at the same time like it currently assumes). The second is something the service handles by throttling the backups taken, rather than trimming after the fact. Trimming after the fact would be pretty wasteful of resources (disk and CPU in particular). This is the purpose of the
Another example using interval:
Does this not work for the scenario you envision? If there’s something missing, lets identify what it is so I can track that in a separate issue (to not overload this one).
Good catch, because the code now uses Swift Concurrency, I don’t have the benefit of serial queues anymore which would prevent multiple backups from running simultaneously. But there’s other mechanisms I can use to block that. I’ve opened #39 to track work to fix that. That said, if a backup is already in progress, I believe it’s better to simply complete the old one and abort the new one. The server has already frozen the filesystem state at that point, so aborting, resuming the save, telling the server to flush again, is a rather messy way to ensure you capture the most recent snapshot. I’d much rather err on the side of simpler logic (for reliability) than try to get too clever here, if that makes sense. |
I suppose that makes sense. I was just thinking to grab the newest snapshot when the last user logs out even those snapshots may be made faster than the interval, but I suppose I may just be over cautious because I lost a world Basically, every time the last person logs out, I would like a backup, but then again my world isn't multiple GB in size... yet... so I could see where more frequent backups could cause issues. It's not a huge thing, just an idea. |
Don’t get me wrong, I’m more trying to understand the need better in the hopes of identifying the right balance to strike, if the existing feature set is not full enough to describe what you want. I just want to strike that balance between simplicity and fullness that keeps the service reliable and reduces complexity and edge cases that need to be thought about in the logic that can make the service harder to maintain as a single developer with maybe a couple hours a week to devote to this. The current model is based around the thinking of “How much play time would I be comfortable losing if I had to rollback?” And I think both approaches have their own merit. The |
Well ideally I don't want it running backups too frequently when I'm actively playing because it lags the server, but then I would like to have it immediately do a backup when I logout so that my most recent changes get backed up I'm not so concerned about CPU resources to back up the world on logout, but I also don't want dozens of backups made by the events. I might have an interval backup every day if it also ran on logout of all players regardless of the minInterval setting and trimmed those event backups down to the most recent one separately from interval backups Maybe I'm just that one user that has a desire for this, maybe not... |
This is enough to properly define the work item. But I guess I’m still a little confused as to the why aspect of it. Why trimming vs throttling backups fired from player events, in your mind? |
To spec something like this out, things that need to happen:
So the config file would have a new option:
And the easiest ways to track the trigger of a backup is either with a journal that is written out as JSON, or by modifying the file names like is done for the partial backups. Although the journal is probably the easier way to go, as it can be a simple [String:String] dictionary. This assumes that all event backups during the last N days want to be kept (this can be dozens in some cases though). Having to do a live trim would be extra functionality. @DanTheMan827, is this sufficient for your needs? My concern here is that this would be pretty heavy on disk space if event backups don't get trimmed for a couple days. |
This has gotten a bit stale, and unfortunately I’m still not convinced that we need the ability to trim the two buckets separately to account for aggressive backup schedules, nor am I sure what problem it is actually solving. I’ve opened #94 to describe the changes I’d like to make to 1.3.x to improve backup scheduling before moving onto the next larger piece of work, which will include the backup journal and some ways to have more frequent backups based on user activity. So for now I’m closing this one, but mostly to say that if we want to go over this again, we should probably do it fresh. |
I see that backup events have been added, but I have a couple suggestions to improve it further
Even though no one may have played on the server in a few days, backups are made like clockwork at the interval configured, this is fine for the most part but it's a waste of space to backup files that haven't changed.
The text was updated successfully, but these errors were encountered: