Skip to content

Commit

Permalink
HBASE-26580 The message of StoreTooBusy is confused (#3949)
Browse files Browse the repository at this point in the history
Signed-off-by: Duo Zhang <[email protected]>
Reviewed-by: Bryan Beaudreault <[email protected]>
  • Loading branch information
zhengzhuobinzzb authored Dec 18, 2021
1 parent ea0fe22 commit d399799
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public void start(Map<byte[], List<Cell>> familyMaps) throws RegionTooBusyExcept
}

String tooBusyStore = null;
boolean aboveParallelThreadLimit = false;
boolean aboveParallelPrePutLimit = false;

for (Map.Entry<byte[], List<Cell>> e : familyMaps.entrySet()) {
Store store = this.region.getStore(e.getKey());
Expand All @@ -123,12 +125,16 @@ public void start(Map<byte[], List<Cell>> 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
Expand All @@ -137,10 +143,15 @@ public void start(Map<byte[], List<Cell>> 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);
}
Expand Down

0 comments on commit d399799

Please sign in to comment.