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

[persist] Design for backup/restore #18157

Merged
merged 5 commits into from
Nov 3, 2023
Merged

Conversation

bkirwi
Copy link
Contributor

@bkirwi bkirwi commented Mar 15, 2023

Motivation

Known-desirable: see MaterializeInc/database-issues#5119 for context.

Tips for reviewer

Click here for the rendered version.

Edit: I've brought this closer to the standard design doc template, and filled in a few details that were left open earlier this year.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • This PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way) and therefore is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • This PR includes the following user-facing behavior changes:

bkirwi added a commit that referenced this pull request Oct 19, 2023
Persist state is a mix of stuff in CRDB and stuff in S3. This
complicates restoring from backup: if we restore CRDB to an old state,
the blobs it references might be deleted.

It's possible to "undelete" deleted blobs in S3 by deleting a delete
marker from an unversioned bucket. This PR implements that logic as a
CLI tool, and implements a basic test that restores a CRDB state and
checks that the database is in the expected state after the CLI runs.

### Motivation

See #18157 for the design.

### Tips for reviewer

One subtlety here is that we can't rely on the usual state iterators,
since those rely on the existence of rollups, which may not exist yet.
The current draft just iterates over the diffs manually.

I have not yet tested this tool against a real environment. I will
probably wait for at least a first pass of code review first!

Co-authored-by: Philip Stoev <[email protected]>
@bkirwi bkirwi marked this pull request as ready for review October 31, 2023 15:13
@bkirwi bkirwi requested review from a team November 1, 2023 20:44
Copy link
Contributor

@danhhz danhhz left a comment

Choose a reason for hiding this comment

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

Overall looks good, left a couple high level comments on a couple sections that might have rotted since it was first written. Will circle back for the full in-depth review (might be next week, unless there's a pressing need, in which case ping me)

doc/developer/design/20230315_backup_restore.md Outdated Show resolved Hide resolved
doc/developer/design/20230315_backup_restore.md Outdated Show resolved Hide resolved
doc/developer/design/20230315_backup_restore.md Outdated Show resolved Hide resolved
@bkirwi
Copy link
Contributor Author

bkirwi commented Nov 2, 2023

Oops, thanks for catching that!

No pressing need; just doing some housekeeping. (This predates the new design process, so the schedule's a bit loose, but anyways it feels like it's ready to go.)

Copy link
Contributor

@danhhz danhhz left a comment

Choose a reason for hiding this comment

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

💯

As always, fantastic work! Your design docs are always so clear and well-reasoned

doc/developer/design/20230315_backup_restore.md Outdated Show resolved Hide resolved
doc/developer/design/20230315_backup_restore.md Outdated Show resolved Hide resolved
@bkirwi bkirwi enabled auto-merge (squash) November 3, 2023 19:25
@bkirwi bkirwi merged commit b3646e7 into MaterializeInc:main Nov 3, 2023
matthewarthur pushed a commit that referenced this pull request Nov 7, 2023
Known-desirable: see #17605 for context.
 
### Tips for reviewer

[Click here for the rendered
version.](https://github.com/bkirwi/materialize/blob/backup-design/doc/developer/design/20230315_backup_restore.md)

I've brought this closer to the standard design doc template, and
filled in a few details that were left open earlier this year.
@joacoc joacoc mentioned this pull request Nov 10, 2023
5 tasks
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

Successfully merging this pull request may close these issues.

2 participants