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

Yinliang/backup and restore add adhoc backup and restore functison #316

Merged

Conversation

shuijing198799
Copy link
Contributor

1.add create secret process
2.add bakcup process
3.add restore process
4.add some parameters via the values.yaml change.
5.use master branch to test
@weekface @zyguan @cwen0 @xiaojingchen PTAL

"mode": "restore",
"user": "root",
"password": to.Password,
"storage.size": "10Gi",
Copy link
Contributor

Choose a reason for hiding this comment

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

10Gi may be too small for backup job

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this setting just suit for my cluster, We can modify it during stress testing。

@tennix tennix added the test/stability stability tests label Mar 13, 2019
Image: "pingcap/tidb-operator:v1.0.0-beta.1-p2",
Tag: "v1.0.0-beta.1-p2",
Image: "pingcap/tidb-operator:latest",
Tag: "latest",
Copy link
Contributor

Choose a reason for hiding this comment

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

latest -> master

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Contributor

@weekface weekface left a comment

Choose a reason for hiding this comment

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

LGTM

@weekface
Copy link
Contributor

@xiaojingchen @tennix @cwen0 @zyguan PTAL

tests/actions.go Outdated
return false, nil
}
if job.Status.Succeeded == 0 {
glog.Error("cluster [%s] back up job is not completed, please wait! ", to.ClusterName)
Copy link
Contributor

Choose a reason for hiding this comment

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

glog.Errorf

BTW: I highly recommand zap or our own logger.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

return 0, err
}

rows, err := db.Query(fmt.Sprintf("SELECT count(*) FROM %s", tableName))
Copy link
Contributor

Choose a reason for hiding this comment

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

var count int
if err := db.QueryRaw(...).Scan(&count); err != nil {
...
}
return count, nil

otherwise, you have to close rows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems all right, I‘ll change it in next PR.

tests/actions.go Show resolved Hide resolved
Copy link
Contributor

@zyguan zyguan left a comment

Choose a reason for hiding this comment

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

LGTM

@weekface weekface merged commit c12bf3b into pingcap:stability Mar 15, 2019
weekface pushed a commit to weekface/tidb-operator that referenced this pull request Mar 21, 2019
tennix pushed a commit that referenced this pull request Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test/stability stability tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants