-
Notifications
You must be signed in to change notification settings - Fork 665
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
Enhance check functionality to support checking starting from a pageId #659
Conversation
@ahrtr so after corrupting a leaf page as discussed on #580 (comment) , running a Tx to execute this is due to the assertions run at Line 82 in 18ebb97
|
We need to verify that checking all other leaf pages should be successful. For example, a branch page contains 3 items, pointing to three different leaf pages. If we intentionally corrupt one leaf page, then checking that page should fail; but checking the other two pages should be successful. It's OK to intentionally change one field like this PR does, but suggest to also support randomly corrupting some bytes in a leaf page. |
5078179
to
fdd0d1b
Compare
fdd0d1b
to
6209500
Compare
The high level workflow/steps:
A related comment: |
7a1bba7
to
51d5cc1
Compare
b7cd5e6
to
c4f168e
Compare
97a2486
to
bd415e9
Compare
bd415e9
to
468054c
Compare
ea86554
to
5169315
Compare
5169315
to
c0938d9
Compare
fixed 👍🏽
fixed 👍🏽
fixed 👍🏽 |
c0d651b
to
7d7267b
Compare
@ahrtr the failing test is due to encodingToHex
this is being using within I dump random bytes to corrupt the page, it is expected to panic, I am stuck :/ |
It seems that we can't randomly corrupt the data. We can only change the key's data to break the btree's invariant property. For example, assuming the key is "0x 12 34 56 78", we intentionally change it to "0x aa bb cc dd". |
but how it worked for all other tests, only this one fails !!! ok i can change the test to read a key and change it, write it again .. but this way the test will be computationally expensive, which is not the test case should be iiuc |
Or we can just remove TestTx_Check_CorruptPage_DumpRandomBytes for now |
7d7267b
to
6038036
Compare
done 👍🏽 |
6038036
to
939e3a2
Compare
Previously the reason why we moved the test case into db_whitebox_test.go was that we need to catch the exception (panicking). Now the test case won't be panicking anymore, so we need to call the exported |
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
939e3a2
to
20e9611
Compare
@ahrtr updated 👍🏽 |
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
97070a2
to
29d1e3d
Compare
Just refactored/simplified the test case in the third commit. |
LGTM |
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
Actually the implementation has a bug, let me fix it in a separate PR. |
Linked to #580 |
This PR add test to changes in #651
cc @ahrtr @fuweid