-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-26901 delete with null columnQualifier occurs NullPointerException when NewVersionBehavior is on #4295
Conversation
…ion when NewVersionBehavior is on
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
…ion when NewVersionBehavior is on
…ion when NewVersionBehavior is on
…ASE-26901 � Conflicts: � hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/NewVersionBehaviorTracker.java � hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNewVersionBehaviorFromClientSide.java
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
Thanks for the fixing.
Out of interest, you enable new version behavior in your cluster? Mind sharing more about the usage and experience? We implemented this feature at Xiaomi but we did not use it on our online clusters finally...
@Apache9 We're considering enabling it for the consistency with mixed operations of Puts and Deletes with timestamp. We are testing now and it's not yet deployed. So we're hardly experienced. |
IIRC, it mainly because of performance issue. @infraio Do you still remember why finally we do not use it in our production? |
…ion when NewVersionBehavior is on (#4295) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 7ac9e0b)
…ion when NewVersionBehavior is on (#4295) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 7ac9e0b)
…ion when NewVersionBehavior is on (#4295) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 7ac9e0b)
…ion when NewVersionBehavior is on (apache#4295) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 7ac9e0b) (cherry picked from commit df01fd4) Change-Id: I10a165e49b609760ba3467664746cbf77a0ccf4b
since HBASE-15616, setting column qualifier as null is possible.
but when NewVersionBehavior is on, delete with null columnQualifier occurs NullPointerException.
NPE happens because delColMap is not initialized and empty.
in this case delColMap.ceilingEntry for empty returns null and NPE happens.
hbase/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/NewVersionBehaviorTracker.java
Line 214 in 1efd8fe
delColMap expected to be initialized (deep copying of delFamMap) when columnQualifier is changed.
But, when null columnQualifier is presented, matchingCq == true and delColMap is never initialized for null columnQualifier deletes.
hbase/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/NewVersionBehaviorTracker.java
Lines 168 to 169 in 1efd8fe
I changed to initialize delColMap if null columnQualifier is presented.
and only if cell is not for columnFamily or columnFamilfyVersion tombstone which is no need to initialize delColMap
I inverted
matchCq
toisColumnQualifierChanged
and reformed if/else statement, I thought it's more clear and fit for purpose.