KulwantSingh011 commented on a change in pull request #3648:
URL: https://github.com/apache/hbase/pull/3648#discussion_r706058307
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
##########
@@ -969,10 +977,25 @@ void doDrain(final List<RAMQueueEntry> entries) throws
InterruptedException {
}
index++;
} catch (BucketAllocatorException fle) {
- LOG.warn("Failed allocation for " + (re == null ? "" : re.getKey())
+ "; " + fle);
+ long currTE = System.currentTimeMillis()/1000; // Current time since
Epoch in seconds.
+ // Record the warning.
+ cacheStats.allocationFailed(re.getData().getSerializedLength());
+ if (prevRecTE == 0) {
+ // The very first exception.
+ LOG.warn("Failed allocation for " + (re == null ? "" :
re.getKey()) + "; " + fle +
+ " HFile: " + (re == null ? "" : re.getKey().getHfileName()));
+ } else {
+ if (currTE - prevRecTE > ALLOCATION_FAIL_TRACE_TIME_GAP) {
+ LOG.warn("Most recent failed allocation in " +
ALLOCATION_FAIL_TRACE_TIME_GAP +
+ "seconds: key: " + (re == null ? "" : re.getKey()) + "; " +
fle +
+ " HFile: " + (re == null ? "" : re.getKey().getHfileName()));
+ }
+ // else do nothing, the exception has already been recorded above.
+ }
// Presume can't add. Too big? Move index on. Entry will be cleared
from ramCache below.
bucketEntries[index] = null;
index++;
+ prevRecTE = currTE;
Review comment:
Nice catch. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]