-
Notifications
You must be signed in to change notification settings - Fork 209
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
Is it possible to backup a live comdb2 database? #365
Comments
Yes- the comdb2ar utility can be used to perform stable backups against a running database, and this backup is restore-able to a stable database image. The trick is to prevent the deletion of logfiles while the backup is running, and to perform recovery on the restored database. comdb2ar queries a running database for the precise LSN to begin recovery against a restored copy. Loosely speaking, this will be a point prior to the oldest LSN of all outstanding dirty pages. See the handling for cmd_logdelete3 in db/appsock_handler.c -> bdb_get_recovery_start_lsn for the details. |
So for the recovery to succeed there must always be a database running, right? |
No- if the database isn't running comdb2ar will default to running fullrecovery against the restored copy. The incremental_backup_load test verifies that comdb2ar is able to perform a stable full-backup and several subsequent incremental backups against a running database loaded with several active writers. See the documentation on our incremental backup system at the bottom of https://bloomberg.github.io/comdb2/backups.html for more information on incremental backups. |
No, that's just an optimization. You can always run recovery starting at the oldest log file. So you can copy while db is down as long as log files are not removed. |
I see. Thanks. |
I read something about backup general database: the database back-end file is not guaranteed to be in a consistent state at any time while the database is running: the database front-end caches LOTS of things that it hasn't necessarily written back to disk. The back-end file is, in busy databases, frequently in an inconsistent state.
I wonder how comdb2 handle this issue.
The text was updated successfully, but these errors were encountered: