-
Notifications
You must be signed in to change notification settings - Fork 101
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
Add sanity check for revision numbers #85
Add sanity check for revision numbers #85
Conversation
Will push unit tests shortly. |
@georgekuruvillak I played around a bit with the |
4440e3d
to
2fec95a
Compare
15583e7
to
50f6ae5
Compare
I have been able to drastically reduce the time taken to get revision number of etcd from the db file, by eliminating iterating through the db buckets and KV pairs. Ready for review. |
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.
I have some suggestions. Please do check it out.
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.
I have commented changes in PR. Please address them.
Currently, lot of code related to test seems to be redundant at multiple places, e.g. pkg/snapshot/restorer/restorer_suite_test.go
and pkg/initializer/validator/validator_suite_test.go
. Also, functions like startEmbeddedEtcd
. We will have to refactor it soon. For this PR, i am fine with it. But we should take next task, to refactor it, cause now basic test framework, all package is set up and we can work optimisation of it. We will create new issue for this.
a671d82
to
c7f1ec5
Compare
@swapnilgm @georgekuruvillak Thanks for your reviews. I've addressed your review comments. PTAL. |
@shreyas-s-rao Thanks for the changes. Overall LGTM. You also, have to update the integration tests accordingly. Please check the last test pipeline logs for the details. https://concourse.ci.infra.gardener.cloud/teams/gardener/pipelines/etcd-backup-restore-master/jobs/master-pull-request-job/builds/33 |
Update: As we saw issue while testing the PR, that for empty ETCD the sanity check fails. Shreyas, will be updating PR for handling this case. |
c7f1ec5
to
3871e39
Compare
@swapnilgm I've updated the PR and fixed the integration tests as well. PTAL. |
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.
What this PR does / why we need it:
This PR adds a sanity check feature to the data validation package, to prevent possible data loss during initialization, by ensuring that the etcd revision is greater than or equal to the latest snapshot revision.
Which issue(s) this PR fixes:
Fixes #67
Special notes for your reviewer:
Release note: