-
Notifications
You must be signed in to change notification settings - Fork 103
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
Take and use backups of the launcher database #1755
Conversation
RebeccaMahany
commented
Jun 14, 2024
•
edited
Loading
edited
- launcher takes periodic backups of its own database, beginning 10 mins after startup
- bbolt checkup includes stats about the backup database
- If its original database is unavailable but a backup is, launcher uses that backup db
- On remote uninstall, the backup database is deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
early nits
return filepath.Join(rootDir, "launcher.db") | ||
} | ||
|
||
func BackupLauncherDbLocation(rootDir string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate to say this, but we probably need to keep N and rotate. Otherwise we can probably get inconsistency if there's a reader and writer. :|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't super worried about that because of how the access remains relatively restricted in this implementation --
- On launcher startup, before any rungroups execute, launcher may rename
launcher.db.bak
tolauncher.db
; nothing else is accessing either db at this time - After rungroups begin to execute, this actor is the only thing touching
launcher.db.bak
-- nothing else will read from it or write to it - (Except for the flare checkup -- and data inconsistency probably isn't a huge deal there, and I'm not sure how much we even care about having that checkup anyway)
- (There's also remote uninstall, but that just wants to delete the file)
Is there something I'm missing?
I'm happy to keep N and rotate if we feel like that's a safer option, regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added rotation in 15183fa -- lmk what you're thinking!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite have the focus to really think through some of this. I think it's okay, and I'm nitpicking small things.
e75bd61
822af61
to
e75bd61
Compare