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

Docs for v17 incremental backup and recovery #1524

Merged
merged 18 commits into from
Jul 12, 2023
Merged

Conversation

shlomi-noach
Copy link
Contributor

This PR adds (late) v17 documentation for incremental backups and recoveries, following these changes in v17:

v17 is already released, and this is a late documentation. For the purposes of review, I've only updated docs/17.0, but once approved, I will copy+paste the changes into docs/18.0 as well. These will be hopefully shortly updated with the new functionality introduced in vitessio/vitess#13270 and some expected followups.

RFC: vitessio/vitess#11227

Please review but do not merge yet

@shlomi-noach shlomi-noach requested a review from a team July 5, 2023 10:56
@netlify
Copy link

netlify bot commented Jul 5, 2023

Deploy Preview for vitess ready!

Name Link
🔨 Latest commit c6bdede
🔍 Latest deploy log https://app.netlify.com/sites/vitess/deploys/64ae3fe38279000008720ac2
😎 Deploy Preview https://deploy-preview-1524--vitess.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -6,6 +6,23 @@ aliases: ['/docs/recovery/pitr','/docs/reference/pitr/']

## Point in Time Recovery

Vitess supports incremental backup and recoveries, aka point in time recoveries. `v17` offers restore-to-position functionality, and `v18` is slated to support restore-to-timestamp functionality.
Copy link
Collaborator

Choose a reason for hiding this comment

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

aka should be capitalized as it's an initialism.

Will v18 support both restore to position AND restore to timestamp, or restore to timestamp will replace restore to position?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

v18 will support both. Clarified in text.

@@ -6,6 +6,23 @@ aliases: ['/docs/recovery/pitr','/docs/reference/pitr/']

## Point in Time Recovery

Vitess supports incremental backup and recoveries, aka point in time recoveries. `v17` offers restore-to-position functionality, and `v18` is slated to support restore-to-timestamp functionality.

Point in time recoveries are based on Full and Incremental backups. It is possible to recover a database to a position that is _covered_ by some backup.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are full and incremental capitalized here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decapitalized.

Comment on lines +24 to +25
## Point in Time Recovery: legacy functionality based on binlog server

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we remove this entire section in the 18.0 docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Per @deepthi , we should keep it for a while.

Example:

```shell
vtctlclient -- RestoreFromBackup --restore_to_pos "MySQL56/0d7aaca6-1666-11ee-aeaf-0a43f95f28a3:1-60" zone1-0000000102
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be a nice enhancement in 18.0 if we expected a valid MySQL GTID set value. i.e. not requiring MySQL56/. That is unnecessary anyway as we only support MySQL (5.7 and 8.0) today. An argument to leave that thought would be that we could re-add support for MariaDB at some point. We can also infer this based on the format of the value though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Catching up on email after vacation and I now see that you're ahead of me 🙂

vitessio/vitess#13415

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

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


Restores are the counterparts of backups. A restore uses the engine utilized to create a backup. One may run a restore from a full backup, or a point-in-time restore (PITR) based on additional incremental backups.

A Vitess restore operates on a tablet. The restore process completely wipes out the data in the tablet's MySQL server and repopulates the server with the backup(s) data. The MySQL server is shutdown durign the process. As a safety mechanism, Vitess by default prevents a restore onto a `PRIMARY` tablet.
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo: durign

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Vitess supports full restores and incremental (aka point in time) restores. The two serve different purposes.

* A full restore loads the dataset from a full backup onto a non-`PRIMARY` tablet. Once the data is loaded, the restore process starts the MySQL service and makes it join the replication stream. It is expected that a freshly restored server will lag behind the shard's `PRIMARY` for a period of time.
The full restore flow is useful for seeding new replica tablets. It may also be used to fix replicas that have been corrupted.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we mean REPLICA tablet types here or really non-PRIMARY tablets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can use any non-PRIMARY type to restore a backup.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd say that then to avoid any confusion (in particular for RDONLY tablets).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@mattlord
Copy link
Collaborator

mattlord commented Jul 5, 2023

Should this PR fix #1490 ?

@shlomi-noach
Copy link
Contributor Author

Indeed.

Fixes #1490.

shlomi-noach and others added 9 commits July 6, 2023 06:57
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
…estore/overview.md

Co-authored-by: Matt Lord <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
…estore/overview.md

Co-authored-by: Matt Lord <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
…estore/overview.md

Co-authored-by: Matt Lord <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
@shlomi-noach shlomi-noach requested a review from a team July 9, 2023 12:42
Vitess supports full restores and incremental (aka point in time) restores. The two serve different purposes.

* A full restore loads the dataset from a full backup onto a non-`PRIMARY` tablet. Once the data is loaded, the restore process starts the MySQL service and makes it join the replication stream. It is expected that a freshly restored server will lag behind the shard's `PRIMARY` for a period of time.
The full restore flow is useful for seeding new replica tablets. It may also be used to fix replicas that have been corrupted.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd say that then to avoid any confusion (in particular for RDONLY tablets).

@shlomi-noach
Copy link
Contributor Author

I will now copy all changes over to v18 and merge.

@shlomi-noach shlomi-noach merged commit b24d21b into prod Jul 12, 2023
@shlomi-noach shlomi-noach deleted the v17-docs-backup-pitr branch July 12, 2023 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants