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

Configurable incremental restore files path #15451

Merged

Conversation

shlomi-noach
Copy link
Contributor

@shlomi-noach shlomi-noach commented Mar 12, 2024

Description

During an incremental restore process, the built-in engine copies backup files onto a temporary directory. Right now this temporary directory is rooted at the default OS temp dir (i.e. /tmp on Linux).

In k8s deployments, this directory is not shared among pods. This means that the files written by the build in engine on one pod, are not visible to mysqlctl on the mysqld pod, where mysqlbinlog binary expects to find and apply them.

This PR adds a vttablet flag named --builtinbackup-incremental-restore-path.

  • If empty, behavior is to use OS default temp dir as root.
  • If nonempty, the directory must exist, and the temporary directory is rooted at given path.

Related Issue(s)

Fixes #14765.

This is an alternative solution to #15440.

Backport to v19

This should be backported to release-19.0 because without this, common k8s deployments can't run point-in-time recoveries.

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

Copy link
Contributor

vitess-bot bot commented Mar 12, 2024

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Mar 12, 2024
@github-actions github-actions bot added this to the v20.0.0 milestone Mar 12, 2024
@shlomi-noach shlomi-noach removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request labels Mar 12, 2024
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 65.63%. Comparing base (d5bd597) to head (df7244c).
Report is 47 commits behind head on main.

Files Patch % Lines
go/vt/mysqlctl/builtinbackupengine.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15451      +/-   ##
==========================================
- Coverage   65.64%   65.63%   -0.01%     
==========================================
  Files        1563     1563              
  Lines      194389   194390       +1     
==========================================
- Hits       127602   127595       -7     
- Misses      66787    66795       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Shlomi Noach <[email protected]>
Copy link
Contributor

@mattlord mattlord left a comment

Choose a reason for hiding this comment

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

We should create an issue here: https://github.com/planetscale/vitess-operator/issues

So that the shared directory between the vttablet and mysqld containers in the vttablet pod is used for this new flag.

I can do that if you prefer, but otherwise each user will need to update their cluster and roll pods in order to address this only after they've attempted a PITR and seen the failure which they then investigated to the point where they discovered the problem, its cause, the flag, and how to specify the override for it in their cluster yaml.

@shlomi-noach
Copy link
Contributor Author

@mattlord I'm grateful if you could do that.

@shlomi-noach shlomi-noach requested a review from a team March 13, 2024 05:58
@shlomi-noach shlomi-noach removed the NeedsBackportReason If backport labels have been applied to a PR, a justification is required label Mar 20, 2024
@systay
Copy link
Collaborator

systay commented Mar 25, 2024

Do we need to add this to the manual as well?

@shlomi-noach
Copy link
Contributor Author

Do we need to add this to the manual as well?

Good point. Will do after merging.

@shlomi-noach shlomi-noach added the Backport to: release-19.0 Needs to be back ported to release-19.0 label Mar 25, 2024
@shlomi-noach shlomi-noach merged commit b3d45fd into vitessio:main Mar 25, 2024
104 checks passed
@shlomi-noach shlomi-noach deleted the incremental-restore-configurable-path branch March 25, 2024 10:19
vitess-bot pushed a commit that referenced this pull request Mar 25, 2024
shlomi-noach pushed a commit that referenced this pull request Mar 25, 2024
…15564)

Signed-off-by: Shlomi Noach <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
@shlomi-noach
Copy link
Contributor Author

Documentation PR: vitessio/website#1711

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.

Bug Report: PITR from timestamp or position not working
3 participants