-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
clientv3: add test for snapshot status #10148
clientv3: add test for snapshot status #10148
Conversation
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.
awesome. Thanks for test case! LGTM.
lgtm |
sp := NewV3(zap.NewExample()) | ||
_, err := sp.Status(dbPath) | ||
expectedErrString := | ||
"snapshot file integrity check failed. 2 errors found.\n" + |
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 is a little bit too strict. i would rather just to make sure the error message include some key words... or if sp.Status's return message changes just a little bit, this unit test breaks.
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 agree. At least I should remove the 2nd and 3rd lines, which are the error messages from bbolt. Any changes to those error messages in bbolt would break this. Thanks for pointing 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.
Addressed. PTAL.
@gyuho |
@gyuho |
e2b27a5
to
647f6f1
Compare
lgtm goword failure is odd, is it really including comma as a token in the string is spell checking? Or am I misunderstanding? |
Triggering rebuild to pick up goword fix in other PR. |
Yeah, for now we can whitelist here https://github.com/etcd-io/etcd/blob/master/.words. |
647f6f1
to
bdb00b9
Compare
Add unit test to check if we can correctly identify a corrupted snapshot backup file.
bdb00b9
to
87beb83
Compare
Add unit test to check if we can correctly identify a corrupted snapshot backup file.
This is a follow up to #10109, where backup file integrity check was added to snapshot status.
Also adding an example snapshot backup file, where its underlying database freelist is corrupted. We saw this issue in our production cluster, this file is an example test file that is reproduced to have the same type of issue.
/cc @gyuho @xiang90 @hexfusion @jpbetz