You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by an...@apache.org on 2021/10/24 03:55:22 UTC

[hbase] branch branch-2 updated: HBASE-26190 High rate logging of BucketAllocatorException: Allocation too big - Addendum (#3792)

This is an automated email from the ASF dual-hosted git repository.

anoopsamjohn pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 444dec9  HBASE-26190 High rate logging of BucketAllocatorException: Allocation too big - Addendum (#3792)
444dec9 is described below

commit 444dec9289db1a82c8a485b3d0138e70df2d2dcb
Author: Anoop Sam John <an...@gmail.com>
AuthorDate: Sun Oct 24 09:19:10 2021 +0530

    HBASE-26190 High rate logging of BucketAllocatorException: Allocation too big - Addendum (#3792)
---
 .../hadoop/hbase/io/hfile/bucket/BucketCache.java       | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
index 6f624c0..a41570d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
@@ -1000,16 +1000,17 @@ public class BucketCache implements BlockCache, HeapSize {
    */
   private String getAllocationFailWarningMessage(RAMQueueEntry re) {
     if (re != null && re.getData() instanceof HFileBlock) {
-      HFileBlock block = (HFileBlock) re.getData();
-      HFileContext fileContext = block.getHFileContext();
-      String hFileName = fileContext.getHFileName();
+      HFileContext fileContext = ((HFileBlock) re.getData()).getHFileContext();
       String columnFamily = Bytes.toString(fileContext.getColumnFamily());
       String tableName = Bytes.toString(fileContext.getTableName());
-      return ("Most recent failed allocation in " + ALLOCATION_FAIL_LOG_TIME_PERIOD
-              + " milliseconds; Table Name = " + tableName + ", Column Family = "
-              + columnFamily + ", HFile Name : " + hFileName);
+      if (tableName != null && columnFamily != null) {
+        return ("Most recent failed allocation in " + ALLOCATION_FAIL_LOG_TIME_PERIOD
+            + " milliseconds; Table Name = " + tableName + ", Column Family = " + columnFamily
+            + ", HFile Name : " + fileContext.getHFileName());
+      }
     }
-    return ("Failed allocation for " + (re == null ? "" : re.getKey()) + "; ");
+    return ("Most recent failed allocation in " + ALLOCATION_FAIL_LOG_TIME_PERIOD
+        + " milliseconds; HFile Name : " + (re == null ? "" : re.getKey()));
   }
 
   /**
@@ -1057,7 +1058,7 @@ public class BucketCache implements BlockCache, HeapSize {
         }
         index++;
       } catch (BucketAllocatorException fle) {
-        long currTs = System.currentTimeMillis(); // Current time since Epoch in milliseconds.
+        long currTs = EnvironmentEdgeManager.currentTime();
         cacheStats.allocationFailed(); // Record the warning.
         if (allocFailLogPrevTs == 0 || (currTs - allocFailLogPrevTs) > ALLOCATION_FAIL_LOG_TIME_PERIOD) {
           LOG.warn (getAllocationFailWarningMessage(re), fle);