Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Bart/bottomless point in time recovery #484

Merged
merged 15 commits into from
Jul 3, 2023

Conversation

Horusiath
Copy link
Contributor

@Horusiath Horusiath commented Jun 28, 2023

This PR adds a point-in-time recovery capabilities to bottomless CLI. We can add optional ute-time argument to provide the last time up to which them PITR should take place. This mechanism uses checkpoint UUID v7 generations to pick up the last machine generation to recover first, then it traverses over the frame batch files and filters them by AWS Last-Modified metadata in order to stop frames at a given time.

The consideration here is that Last-Modified timestamp may not be what users expect. Additionally it marks a time when file had been sent to S3, not the time when checkpoint backup was made: ie. when we stored WAL frames in local file system, but didn't managed to send them right away, but rather during the restore process, they won't be included in overall restore state. In such cases we could include timestamps in file/S3 object names.

@Horusiath Horusiath marked this pull request as ready for review June 28, 2023 14:40
@Horusiath Horusiath requested a review from psarna June 28, 2023 14:40
Copy link
Contributor

@psarna psarna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, one nitpick that can be done as a follow-up

match verify.to_lowercase().as_ref() {
"yes" | "true" | "1" | "y" | "t" => options.verify_crc = true,
"no" | "false" | "0" | "n" | "f" => options.verify_crc = false,
_ => { /* unknown option */ }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: let's tracing::warn in that case to let the user know something's wrong -- by printing whatever the user passed and the legal values

@psarna psarna added this pull request to the merge queue Jul 3, 2023
Merged via the queue into libsql:main with commit 46ecbbc Jul 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants