-
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
Implemented PITR-2 #6408
Implemented PITR-2 #6408
Conversation
- Added flags for restore to time - Added flags for binlog server details Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
- added ability to fetch the GTID from the restore time - added ability to apply the binlogs till the above GTID Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
…chan Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
1bffb9e
to
dc8af79
Compare
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
fb065be
to
a989cf2
Compare
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
@@ -64,6 +64,11 @@ type Engine struct { | |||
notifierMu sync.Mutex | |||
notifiers map[string]notifier | |||
|
|||
// SkipMetaCheck skips the metadata about the database and table information | |||
SkipMetaCheck bool |
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.
@sougou , is it ok if we add this flag here? This flag will skip the sql query to get table information ( form information_schema). We need this when we need to get the GTID from timestamp , as the binlog server does not support the query and we also don't need that info in that process.
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.
Sounds good for now. I see that you're just using it to covert timestamp to gtid. There may be a simpler way to do that without having to use vstream, but we can use this method until we figure that out.
…le names Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
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.
Mostly comments and documentation, but there is an important logic issue as well.
binlogPort = flag.Int("binlog_port", 0, "(PITR restore parameter) port of binlog server.") | ||
binlogUser = flag.String("binlog_user", "", "(PITR restore parameter) username of binlog server.") | ||
binlogPwd = flag.String("binlog_password", "", "(PITR restore parameter) password of binlog server.") | ||
timeoutForGTIDLookup = flag.Duration("binlog_lookup_timeout", 60*time.Second, "(PITR restore parameter) timeout for fetching gtid from timestamp.") |
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 do you think of gtid_lookup_timeout
for this flag name?
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.
that does not signifies which gtid
we are referring to, let me know if we should use that.
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.
recovery_gtid_lookup_timeout?
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
I have implemented the suggestion you mentioned. |
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
go/mysql/flavor_mysql.go
Outdated
@@ -32,7 +32,8 @@ type mysqlFlavor struct{} | |||
|
|||
// masterGTIDSet is part of the Flavor interface. | |||
func (mysqlFlavor) masterGTIDSet(c *Conn) (GTIDSet, error) { | |||
qr, err := c.ExecuteFetch("SELECT @@GLOBAL.gtid_executed", 1, false) | |||
// making @@global as lowercase, as the PITR depends on binlog server, which honours only lowercase `global` value |
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.
Let's just make this:
// keep @@global as lowercase, as some servers like the Ripple binlog server only honors a lowercase `global` value
Otherwise people might get confused (since this is not PITR-specific code)
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.
Agreed, I have updated the comment.
Can you balance tests between docker_test_1 and docker_test_2?
|
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
I have balanced the tests |
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
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 new logic looks good.
A few more nits. We can merge once those are addressed.
if proc, err := tablet.MysqlctlProcess.StartProcess(); err != nil { | ||
return err | ||
} else { | ||
// ignore golint warning, we need the else block to use proc |
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.
don't you need a //nolint
here? otherwise CI will fail.
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.
not sure why golangci-lint did not capture this earlier, it is passing without //nolint
, to be on safe side I have added it.
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
Implemented the suggested changes and also updated the flag name. |
Very nice work! This has been a long-standing request. |
Implemented PITR-2
Fixes #6267, fixes #4886
Here are the changes I did.