HBASE-26580 The message of StoreTooBusy is confused (#3949)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Reviewed-by: Bryan Beaudreault <bbeaudreault@hubspot.com>
This commit is contained in:
zhengzhuobinzzb 2021-12-18 23:22:14 +08:00 committed by GitHub
parent ea0fe2222d
commit d399799c29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 4 deletions

View File

@ -109,6 +109,8 @@ public class StoreHotnessProtector {
}
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());
@ -123,12 +125,16 @@ public class StoreHotnessProtector {
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 class StoreHotnessProtector {
}
}
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);
}