-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[HBASE-25246] Backup/Restore hbase cell tags. #2745
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
Conversation
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@anoopsjohn @virajjasani Could you please provide your feedback. Thank you !! |
|
Thank you @anoopsjohn and @virajjasani for your offline help. Could you guys please review the changes. Thank you ! |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
anoopsjohn
left a comment
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.
Looks good. Added few minor suggestions.
Can u also add a jira to check abt other tools? There is another way of Export tool right which uses CPEP. Also CopyTable should make sure copying tags.
| ProtobufUtil.toCell(cell, false); | ||
| assertNotNull(protoCell); | ||
|
|
||
| Cell decodedCell = getCellFromProtoResult(protoCell, false); |
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.
Can you also add getCellFromProtoResult(protoCell, true ); and assert not tags come back. This clearly assert when POJO is encoded to PB object no tags been encoded.
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.
The boolean parameter in getCellFromProtoResult method is whether to encode tags or not. If that boolean (encodeTags) is set to true then response will return tags if it contains tags.
If encodeTags is set to false, then response will not return tags even if the cell contains tags.
I have 2 tests testCellConversionWithoutTags and testCellConversionWithTags which tests the above 2 scenarios.
For both of the tests the cell contains 1 tags.
testCellConversionWithoutTags method will set the encodeTags boolean to false and verifies whether response doesn't contain tags.
testCellConversionWithTags method will set the encodeTags boolean to true and verifies whether response does contain tags.
@anoopsjohn Does that answer your question or maybe I am not able to understand the question properly. Please elaborate if its the latter case. Thank you !
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.
One test is passing true while doing encoding and then passing true while decoding and make sure tags come back
The other pass both as false and make sure no tags present in final decoded cell. Good
What my request was to have a test case where the encode time will say false. And then decode call pass true(if any tags in serialized form decode that) and assert still no tags are present in final decoded Cell. The second test case will pass even if tomorrow the encode logic changed to serialize tags always (which we dont want to happen). So the new test case really assert that while encoding if boolean param is false its not really serializing the tags. You follow now? Sorry for not being clear in my earlier comment
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.
@anoopsjohn Makes sense. Added a new test case as per your feedback. Thank you !
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.
It seems we have good coverage, maybe one more possibility: encode with true and decode with false should also result in no tags available in decoded cell. Not blocker but good to have this test?
| String[] args = new String[] { | ||
| "-D" + ExportUtils.RAW_SCAN + "=true", | ||
| // This will make sure that codec will encode and decode tags in rpc call. | ||
| "-Dhbase.client.rpc.codec=org.apache.hadoop.hbase.codec.KeyValueCodecWithTags", |
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.
If we have entry in book regarding Export tool, we can add this detail also there about changing Codec. Can be done in another issue too.
| d.setAttribute(TEST_ATTR, Bytes.toBytes(TEST_TAG)); | ||
| exportT.delete(d); | ||
|
|
||
| // Run export too with KeyValueCodecWithTags as Codec. This will ensure that export tool |
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.
export tool
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
This seems relevant? https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2745/6/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-root.txt |
virajjasani
left a comment
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.
+1, left one comment.
| ProtobufUtil.toCell(cell, false); | ||
| assertNotNull(protoCell); | ||
|
|
||
| Cell decodedCell = getCellFromProtoResult(protoCell, false); |
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.
It seems we have good coverage, maybe one more possibility: encode with true and decode with false should also result in no tags available in decoded cell. Not blocker but good to have this test?
|
Failed test TestReplicationEndpointWithMultipleAsyncWAL ran successfully locally. @virajjasani Added test case according to your feedback. Thank you ! |
|
Thanks @shahrs87 , after QA results, this is good to go. In the meanwhile, you can keep branch-2 and branch-1 ready with latest changes. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@shahrs87 https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2745/9/testReport/ Can you once confirm locally? Unless quite many changes required, we can merge this soon anyways. |
|
TestIncrementalBackupWithBulkLoad succeeds locally. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
Closes #2745 Signed-off-by: Anoop Sam John <[email protected]> Signed-off-by: Viraj Jasani <[email protected]>
Closes #2745 Signed-off-by: Anoop Sam John <[email protected]> Signed-off-by: Viraj Jasani <[email protected]>
Closes #2745 Signed-off-by: Anoop Sam John <[email protected]> Signed-off-by: Viraj Jasani <[email protected]>
Closes #2745 Signed-off-by: Anoop Sam John <[email protected]> Signed-off-by: Viraj Jasani <[email protected]>
Closes #2745 Signed-off-by: Anoop Sam John <[email protected]> Signed-off-by: Viraj Jasani <[email protected]>
Closes apache#2745 Signed-off-by: Anoop Sam John <[email protected]> Signed-off-by: Viraj Jasani <[email protected]> (cherry picked from commit b1a1d47) Change-Id: Ie90d6b3182c9097e4760ab34aef2311ba483a64e
@anoopsjohn @virajjasani I have added a boolean flag (encodeTags/decodeTags) in ProtobufUtil which will evaluate to true if client cell block support is enabled.
Could you please tell me if I am thinking in the right direction ? Thank you !