You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2024/03/28 15:57:09 UTC

(hbase) branch branch-2.6 updated (8ec5fb04573 -> 8b8af3a9547)

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

zhangduo pushed a change to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/hbase.git


    from 8ec5fb04573 HBASE-28450 BuckeCache.evictBlocksByHfileName won't work after a cache recovery from file (#5769)
     new c057037e1b5 HBASE-27990 BucketCache causes ArithmeticException due to improper blockSize value checking (#5389)
     new fbe4a5f1d80 HBASE-27989 ByteBuffAllocator causes ArithmeticException due to improper poolBufSize value checking (#5388)
     new 8efab23c8a5 HBASE-28452 Missing null check of rpcServer.scheduler.executor causes NPE with invalid value of hbase.client.default.rpc.codec (#5778)
     new 8b8af3a9547 HBASE-27993 AbstractFSWAL causes ArithmeticException due to improper logRollSize value checking (#5390)

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java   | 8 ++++++++
 .../java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java | 2 ++
 .../main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java   | 4 +++-
 .../org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java   | 3 +++
 4 files changed, 16 insertions(+), 1 deletion(-)


(hbase) 04/04: HBASE-27993 AbstractFSWAL causes ArithmeticException due to improper logRollSize value checking (#5390)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8b8af3a954766ddd909516f695277f63f85f939e
Author: ConfX <11...@users.noreply.github.com>
AuthorDate: Thu Mar 28 23:04:02 2024 +0800

    HBASE-27993 AbstractFSWAL causes ArithmeticException due to improper logRollSize value checking (#5390)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    Signed-off-by: Wei-Chiu Chuang <we...@apache.org>
    (cherry picked from commit 8be9e51fdf474a94b12aab63332f8bb0344854f6)
---
 .../java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java   | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
index e173f1ebe77..cdeb7e84e06 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
@@ -379,6 +379,9 @@ public abstract class AbstractFSWAL<W extends WriterBase> implements WAL {
   }
 
   private int calculateMaxLogFiles(Configuration conf, long logRollSize) {
+    checkArgument(logRollSize > 0,
+      "The log roll size cannot be zero or negative when calculating max log files, "
+        + "current value is " + logRollSize);
     Pair<Long, MemoryType> globalMemstoreSize = MemorySizeUtil.getGlobalMemStoreSize(conf);
     return (int) ((globalMemstoreSize.getFirst() * 2) / logRollSize);
   }


(hbase) 02/04: HBASE-27989 ByteBuffAllocator causes ArithmeticException due to improper poolBufSize value checking (#5388)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fbe4a5f1d80e74310edae5424c6f7f43e3eaceae
Author: ConfX <11...@users.noreply.github.com>
AuthorDate: Thu Mar 28 23:01:40 2024 +0800

    HBASE-27989 ByteBuffAllocator causes ArithmeticException due to improper poolBufSize value checking (#5388)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit bfc537562c86c5b41a52a1eff50bc6c85e89caf9)
---
 .../main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java   | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java
index 2176949b291..3a9484bd306 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java
@@ -175,11 +175,19 @@ public class ByteBuffAllocator {
       // that by the time a handler originated response is actually done writing to socket and so
       // released the BBs it used, the handler might have processed one more read req. On an avg 2x
       // we consider and consider that also for the max buffers to pool
+      if (poolBufSize <= 0) {
+        throw new IllegalArgumentException(BUFFER_SIZE_KEY + " must be positive. Please disable "
+          + "the reservoir rather than setting the size of the buffer to zero or negative.");
+      }
       int bufsForTwoMB = (2 * 1024 * 1024) / poolBufSize;
       int maxBuffCount =
         conf.getInt(MAX_BUFFER_COUNT_KEY, conf.getInt(HConstants.REGION_SERVER_HANDLER_COUNT,
           HConstants.DEFAULT_REGION_SERVER_HANDLER_COUNT) * bufsForTwoMB * 2);
       int minSizeForReservoirUse = conf.getInt(MIN_ALLOCATE_SIZE_KEY, poolBufSize / 6);
+      if (minSizeForReservoirUse <= 0) {
+        LOG.warn("The minimal size for reservoir use is less or equal to zero, all allocations "
+          + "will be from the pool. Set a higher " + MIN_ALLOCATE_SIZE_KEY + " to avoid this.");
+      }
       Class<?> clazz = conf.getClass(BYTEBUFF_ALLOCATOR_CLASS, ByteBuffAllocator.class);
       return (ByteBuffAllocator) ReflectionUtils.newInstance(clazz, true, maxBuffCount, poolBufSize,
         minSizeForReservoirUse);


(hbase) 01/04: HBASE-27990 BucketCache causes ArithmeticException due to improper blockSize value checking (#5389)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c057037e1b533a94a60715b7927acc70f7619997
Author: ConfX <11...@users.noreply.github.com>
AuthorDate: Thu Mar 28 23:01:23 2024 +0800

    HBASE-27990 BucketCache causes ArithmeticException due to improper blockSize value checking (#5389)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit 5a0c4de66b16281b25fd14bfbe2ee60d0657b8a3)
---
 .../main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java  | 2 ++
 1 file changed, 2 insertions(+)

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 0f22fb5ce7f..965b9776023 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
@@ -279,6 +279,8 @@ public class BucketCache implements BlockCache, HeapSize {
   public BucketCache(String ioEngineName, long capacity, int blockSize, int[] bucketSizes,
     int writerThreadNum, int writerQLen, String persistencePath, int ioErrorsTolerationDuration,
     Configuration conf) throws IOException {
+    Preconditions.checkArgument(blockSize > 0,
+      "BucketCache capacity is set to " + blockSize + ", can not be less than 0");
     this.algorithm = conf.get(FILE_VERIFY_ALGORITHM, DEFAULT_FILE_VERIFY_ALGORITHM);
     this.ioEngine = getIOEngineFromName(ioEngineName, capacity, persistencePath);
     this.writerThreads = new WriterThread[writerThreadNum];


(hbase) 03/04: HBASE-28452 Missing null check of rpcServer.scheduler.executor causes NPE with invalid value of hbase.client.default.rpc.codec (#5778)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8efab23c8a542cb2ff819ba6b91a776276077fbc
Author: ConfX <11...@users.noreply.github.com>
AuthorDate: Thu Mar 28 23:02:07 2024 +0800

    HBASE-28452 Missing null check of rpcServer.scheduler.executor causes NPE with invalid value of hbase.client.default.rpc.codec (#5778)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit f412bdbb9ad9810e9bf3db0b76f7f1dffff3d15d)
---
 .../src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java
index b51154fc24e..842366d625f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java
@@ -68,7 +68,9 @@ public class FifoRpcScheduler extends RpcScheduler {
 
   @Override
   public void stop() {
-    this.executor.shutdown();
+    if (this.executor != null) {
+      this.executor.shutdown();
+    }
   }
 
   private static class FifoCallRunner implements Runnable {