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

Implemented pitr testcase #6594

Merged
merged 4 commits into from
Aug 26, 2020
Merged

Implemented pitr testcase #6594

merged 4 commits into from
Aug 26, 2020

Conversation

pankajgavit
Copy link
Contributor

  • Implemented PITR recovery test which uses binlog server for pitr recovery.
  • It tests pitr when we have single shard and multiple shards also.
  • Removed tests from the pitr_test.go and incorporated them in the TestPITRRecovery test

Fixes :

  • Added a fix in restore.go in getGTIDFromTimestamp where it fails to recover when we have one last event after the restoreTime/snapshotTime.

Signed-off-by: Pankaj Gavit <pankaj.gavit777@gmail.com>

…gle shard. It also tests pitr for multiple shards when a single shard is resharded.

Signed-off-by: Pankaj Gavit <pankaj.gavit777@gmail.com>
@@ -38,7 +38,7 @@ type mysqlMaster struct {

// newBinlogServer returns an instance of binlog server
func newBinlogServer(hostname string, port int) (*binLogServer, error) {
dataDir := path.Join(os.Getenv("VTDATAROOT"), binlogDataDir)
dataDir := path.Join(os.Getenv("VTDATAROOT"), binlogDataDir+"_"+fmt.Sprintf("%d", port))
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: if we are doing fmt.Sprintf, can't the whole string be created this way instead of mixing concatenation and sprintf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used fmt.Sprintf() func to create a string

@@ -0,0 +1,523 @@
package pitr
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing license header

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added license header

Signed-off-by: Pankaj Gavit <pankaj.gavit777@gmail.com>
Signed-off-by: Pankaj Gavit <pankaj.gavit777@gmail.com>
@@ -0,0 +1,539 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

Because you renamed the file, I can't tell what changed. Can you rename this to pitr_test.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The codeflow of current testcase is totally different from the previous testcase. As there will be a lot of diff between the previous testcase and current testcase, I kept a different filename.

If required, I will change the filename back to pitr_test.go

Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

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

Nice work!
One minor nit: typo.

go/test/endtoend/recovery/pitr/shardedpitr_test.go Outdated Show resolved Hide resolved
Co-authored-by: Deepthi Sigireddi <deepthi.sigireddi@gmail.com>
Signed-off-by: Pankaj Gavit <pankaj.gavit777@gmail.com>
@deepthi deepthi merged commit 277596e into vitessio:master Aug 26, 2020
@askdba askdba added this to the v8.0 milestone Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants