-
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-27531 AsyncRequestFutureImpl unnecessarily clears meta cache for full server #4930
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
ff21a5b
to
ee4eba4
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Current spotless failure is due to https://issues.apache.org/jira/browse/HBASE-27474. The net-new code here is clean for spotless. |
ee4eba4
to
51f193c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
51f193c
to
c842086
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@@ -989,7 +989,7 @@ private void invokeCallBack(byte[] regionName, byte[] row, CResult result) { | |||
} | |||
|
|||
private void cleanServerCache(ServerName server, Throwable regionException) { | |||
if (ClientExceptionsUtil.isMetaClearingException(regionException)) { | |||
if (tableName == null && ClientExceptionsUtil.isMetaClearingException(regionException)) { |
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.
In which case tableName could be null?
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's only null for HTableMultiplexer
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 reverts the logic back to pre-21775: 5f25985#diff-7c58ffd83c150488599591ed5a3a068599646ebdbbbfdcd2233386e5472cca35L921
The tableName == null
check here was standing for very long prior to that. I don't think it was correct to remove, since in the tableName != null
(most usages) we'd fall into updateCachedLocations which clears the cache just for the individual regions.
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.
@Apache9 can you give another look?
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.
@saintstack Do you still remember something sir? Skimmed the patch, I'm not sure why removing the tableName == null
check can fix the problem described in HBASE-21775, as Tommy Li said
from what I can see, tableName shouldn't be null unless you manually create a BufferedMutatorImpl instead of using ConnectionFactory.createConnection().getBufferedMutator(). I not sure if the bufferedmutator would work at all without a table name.
…r full server (#4930) Signed-off-by: Duo Zhang <[email protected]>
… clears meta cache for full server (apache#4930) (apache#158) * CDPD-73638: Backport HBASE-27531 AsyncRequestFutureImpl unnecessarily clears meta cache for full server (apache#4930) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 1c98931) Change-Id: If18b2add03e0509b7b778fcb14c2448353adf442 * CDPD-73638 - TestAsyncProcess.java fix Change-Id: I1d18f40b052ca2b62bd5428678cbd6a90a859977 --------- Co-authored-by: Bryan Beaudreault <[email protected]>
This reverts to the original behavior prior to https://issues.apache.org/jira/browse/HBASE-21775, which never cleared the full server cache for normal multigets. The null tableName scenario is only in the case of HTableMultiplexer, otherwise tableName is always available. It only makes sense to clear the full cache for requests where we can't determine the correct region to clear, like in HTableMultiplexer.
Skipping the full server clear here is good because:
cleanServerCache
is called has a subsequent call toupdateCachedLocations
for the individual regions.The test provided in HBASE-21775 didn't actually test the problem. It just tested that the newly ungated call to cleanServerCache was called. I updated the tests here which help verify that the existing call to updateCachedLocations is enough to recover from any failure.
There are two ways errors are handled:
I added two test cases, one for each case.