Skip to content
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

Marking backups as "in progress" or "finished" #49

Open
abbbi opened this issue Aug 20, 2024 · 3 comments
Open

Marking backups as "in progress" or "finished" #49

abbbi opened this issue Aug 20, 2024 · 3 comments

Comments

@abbbi
Copy link
Collaborator

abbbi commented Aug 20, 2024

While working on the sync feature #48 i noticed that for sync the syncjob checks by identifying if an backup is active by using the "Size" flag of an snapshot:

       Ok(snapshot_list
            .into_iter()
            .filter_map(|item: SnapshotListItem| {
                let snapshot = item.backup;
                // in-progress backups can't be synced                                                                                  
                if item.size.is_none() {
                    task_log!(
                        worker,
                        "skipping snapshot {} - in-progress backup",

while we can "fake" this response for the sync to work, the current implementation has no real way to determine if an
backup is still active.

I think we could either use an "active" flag which is added as the backup starts and cleared as it is finished?

@tizbac
Copy link
Owner

tizbac commented Aug 20, 2024 via email

@tizbac
Copy link
Owner

tizbac commented Aug 20, 2024

Only edge case it comes to my mind is proxy crashing while doing backup and unable to remove it, a clean way without duplication would be setting the corrupt flag and removing it when done

@abbbi
Copy link
Collaborator Author

abbbi commented Aug 20, 2024

Only edge case it comes to my mind is proxy crashing while doing backup and unable to remove it, a clean way without duplication would be setting the corrupt flag and removing it when done

yes. Also, signal handling should be added so it could be shutdown "gracefully", means if it receives kill signal and there are still active sessions, wait until they are gone for X seconds, then shutdown.

Maybe it shouldnt write the stuff into the backups/ folder in the first place,but something like active/ first, and if the backup finishes move the directory to the backups folder (atomic).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants