-
Notifications
You must be signed in to change notification settings - Fork 2.3k
mysqlctl: add CloneFromDonor
#19064
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
mysqlctl: add CloneFromDonor
#19064
Conversation
Add core infrastructure for MySQL CLONE REMOTE operations: - CloneExecutor in mysqlctl/clone.go for executing CLONE INSTANCE FROM - Clone user configuration in dbconfigs (--db-clone-user, --db-clone-password, --db-clone-use-ssl) - vt_clone user in init_db.sql with BACKUP_ADMIN privilege (MySQL 8.0.17+ only) - Clone plugin loading in mycnf configs (plugin-load-add = mysql_clone.so) - MySQLClonePluginFlavorCapability for version checking MySQL CLONE copies data at the physical level over the network, providing a faster alternative to logical backup/restore for replica provisioning. Requires MySQL 8.0.17+ and InnoDB-only tables. Signed-off-by: Nick Van Wiggeren <[email protected]>
Signed-off-by: Nick Van Wiggeren <[email protected]>
Signed-off-by: Nick Van Wiggeren <[email protected]>
Signed-off-by: Max Englander <[email protected]>
…o be marked as completed after the CLONE is done Signed-off-by: Nick Van Wiggeren <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19064 +/- ##
========================================
Coverage 69.89% 69.90%
========================================
Files 1612 1613 +1
Lines 215826 216076 +250
========================================
+ Hits 150857 151044 +187
- Misses 64969 65032 +63 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Co-authored-by: Nick Van Wiggeren <[email protected]> Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
f179b40 to
bf13376
Compare
Signed-off-by: Max Englander <[email protected]>
nickvanw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, I suggest we write website documentation and changelog entries when the stacked PRs are fully complete.
mattlord
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! ❤️ Just a couple of minor comments.
go/vt/mysqlctl/clone.go
Outdated
| return replication.Position{}, errors.New("--clone-from-primary and --clone-from-tablet are mutually exclusive") | ||
| case cloneFromPrimary: | ||
| // Look up the primary tablet from topology. | ||
| log.Infof("Looking up primary tablet for shard %s/%s", keyspace, shard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth adding some context like "for use as CLONE REMOTE target" to the log messages. For the errors returned, we can/should wrap them with that context at the CloneFromDonor call site (there isn't one in this PR so we have to maintain that context ourselves across the PRs).
Co-authored-by: Matt Lord <[email protected]> Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
55d39fb to
2089cf2
Compare
Signed-off-by: Max Englander <[email protected]>
|
📝 Documentation updates detected! Updated existing suggestion: Add changelog entries for MySQL CLONE support |
Description
Next step after #19062.
That PR is adapted from @nickvanw's work in a private fork. Adds the base infrastructure for using
CLONEat theMysqlDaemonlevel. This PR carries that work one level up, to the topology.CloneFromDonorreads CLI flags--clone-from-primaryand--clone-from-tablet. Depending on which of the two options is chosen, it uses topology to idenfity the host and port of the selected donor, and then usesCloneExecutorto perform the clone from that donor to the local recipient.Related Issue(s)
Checklist
Deployment Notes
AI Disclosure
AI was used.