From d399799c29fa4d485e664508c4f5f671d3140763 Mon Sep 17 00:00:00 2001 From: zhengzhuobinzzb Date: Sat, 18 Dec 2021 23:22:14 +0800 Subject: [PATCH] HBASE-26580 The message of StoreTooBusy is confused (#3949) Signed-off-by: Duo Zhang Reviewed-by: Bryan Beaudreault --- .../throttle/StoreHotnessProtector.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java index b907aa640093..7cb3a24dde76 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java @@ -109,6 +109,8 @@ public void start(Map> familyMaps) throws RegionTooBusyExcept } String tooBusyStore = null; + boolean aboveParallelThreadLimit = false; + boolean aboveParallelPrePutLimit = false; for (Map.Entry> e : familyMaps.entrySet()) { Store store = this.region.getStore(e.getKey()); @@ -123,12 +125,16 @@ public void start(Map> familyMaps) throws RegionTooBusyExcept int preparePutCount = preparePutToStoreMap .computeIfAbsent(e.getKey(), key -> new AtomicInteger()) .incrementAndGet(); - if (store.getCurrentParallelPutCount() > this.parallelPutToStoreThreadLimit - || preparePutCount > this.parallelPreparePutToStoreThreadLimit) { + boolean storeAboveThread = + store.getCurrentParallelPutCount() > this.parallelPutToStoreThreadLimit; + boolean storeAbovePrePut = preparePutCount > this.parallelPreparePutToStoreThreadLimit; + if (storeAboveThread || storeAbovePrePut) { tooBusyStore = (tooBusyStore == null ? store.getColumnFamilyName() : tooBusyStore + "," + store.getColumnFamilyName()); } + aboveParallelThreadLimit |= storeAboveThread; + aboveParallelPrePutLimit |= storeAbovePrePut; if (LOG.isTraceEnabled()) { LOG.trace(store.getColumnFamilyName() + ": preparePutCount=" + preparePutCount @@ -137,10 +143,15 @@ public void start(Map> familyMaps) throws RegionTooBusyExcept } } - if (tooBusyStore != null) { + if (aboveParallelThreadLimit || aboveParallelPrePutLimit) { String msg = "StoreTooBusy," + this.region.getRegionInfo().getRegionNameAsString() + ":" + tooBusyStore - + " Above parallelPutToStoreThreadLimit(" + this.parallelPutToStoreThreadLimit + ")"; + + " Above " + + (aboveParallelThreadLimit ? "parallelPutToStoreThreadLimit(" + + this.parallelPutToStoreThreadLimit + ")" : "") + + (aboveParallelThreadLimit && aboveParallelPrePutLimit ? " or " : "") + + (aboveParallelPrePutLimit ? "parallelPreparePutToStoreThreadLimit(" + + this.parallelPreparePutToStoreThreadLimit + ")" : ""); LOG.trace(msg); throw new RegionTooBusyException(msg); }