-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fixing issue with xtrabackup and long gtids #16304
Conversation
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
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16304 +/- ##
==========================================
- Coverage 68.71% 68.68% -0.04%
==========================================
Files 1544 1548 +4
Lines 198011 199094 +1083
==========================================
+ Hits 136064 136738 +674
- Misses 61947 62356 +409 ☔ View full report in Codecov by Sentry. |
go/vt/mysqlctl/xtrabackupengine.go
Outdated
@@ -300,6 +312,7 @@ func (be *XtrabackupEngine) backupFiles( | |||
"--slave-info", | |||
"--user=" + xtrabackupUser, | |||
"--target-dir=" + params.Cnf.TmpDir, | |||
"--extra-lsndir=" + tempDir, |
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.
@rvrangel will this flag exist in "most" recent versions of xtrabackup
?
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.
good question, it is present since the 2.4 EOL version, so any recent version should have it I imagine.
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.
Where will the temporary directory be created by default? Are we sure to have the necessary permissions?
I'm wondering why not use params.Cnf.TmpDir
and just write the file there.
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.
it will default to the system's $TMPDIR
(usually /tmp
) which we should almost always have permissions, the idea was that we could just remove it once we are done. but if we want to create it under params.Cnf.TmpDir
, seems like the --target-dir
is mostly unused because we stream the backup to STDOUT
.
we could also use that path directly and instead of creating the temporary subdirectory and we either delete the files separately (it is just xtrabackup_info
and xtrabackup_checkpoints
) or we could just leave them there as the result of the last xtrabackup
taken. @deepthi do you have a preference?
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.
What are the pros and cons of leaving the files behind versus deleting them? The next backup would overwrite them anyway, right?
Beyond this one decisions, almost any of the options would work. It's probably a bit simpler to not create a new temporary directory and just use one of the existing ones.
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.
leaving them is mostly for investigation (if needed), I guess we can just not remove them so there is a copy in the temp folder of the files from the last backup attempt in case an operator wants to look at it, otherwise it will just get overwritten the next time a backup is taken. I will update the PR tomorrow
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.
PR has been updated 🙌
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 will be a good change. The original implementation was definitely somewhat naive :)
go/vt/mysqlctl/xtrabackupengine.go
Outdated
@@ -300,6 +312,7 @@ func (be *XtrabackupEngine) backupFiles( | |||
"--slave-info", | |||
"--user=" + xtrabackupUser, | |||
"--target-dir=" + params.Cnf.TmpDir, | |||
"--extra-lsndir=" + tempDir, |
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.
Where will the temporary directory be created by default? Are we sure to have the necessary permissions?
I'm wondering why not use params.Cnf.TmpDir
and just write the file there.
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.
The DCO check needs to be fixed before we can merge this.
The actual changes look good.
Signed-off-by: Renan Rangel <rrangel@slack-corp.com>
e28ee4d
to
fa9969f
Compare
Signed-off-by: Renan Rangel <rrangel@slack-corp.com>
Signed-off-by: Renan Rangel <rrangel@slack-corp.com>
Signed-off-by: Renan Rangel <rrangel@slack-corp.com> Co-authored-by: Renan Rangel <rvrangel@users.noreply.github.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
#510) * fixing issue with xtrabackup and long gtids (vitessio#16304) Signed-off-by: Renan Rangel <rrangel@slack-corp.com> * fix file format * fix format --------- Signed-off-by: Renan Rangel <rrangel@slack-corp.com> Co-authored-by: Renan Rangel <rvrangel@users.noreply.github.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Renan Rangel <rrangel@slack-corp.com>
Description
Instead of reading the GTIDs from the
xtrabackup
output, this will make use of the--extra-lsndir
flag to output a copy of thextrabackup_info
file which has the full GTID information, instead of reading it from theSTDERR
where it eventually gets truncated after the line size gets close to ~8KBRelated Issue(s)
Fixes #16303
Checklist
Deployment Notes