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:
parent
101d21f25f
commit
9c01d04354
|
@ -108,6 +108,8 @@ public class StoreHotnessProtector {
|
||||||
}
|
}
|
||||||
|
|
||||||
String tooBusyStore = null;
|
String tooBusyStore = null;
|
||||||
|
boolean aboveParallelThreadLimit = false;
|
||||||
|
boolean aboveParallelPrePutLimit = false;
|
||||||
|
|
||||||
for (Map.Entry<byte[], List<Cell>> e : familyMaps.entrySet()) {
|
for (Map.Entry<byte[], List<Cell>> e : familyMaps.entrySet()) {
|
||||||
Store store = this.region.getStore(e.getKey());
|
Store store = this.region.getStore(e.getKey());
|
||||||
|
@ -119,19 +121,19 @@ public class StoreHotnessProtector {
|
||||||
|
|
||||||
//we need to try to add #preparePutCount at first because preparePutToStoreMap will be
|
//we need to try to add #preparePutCount at first because preparePutToStoreMap will be
|
||||||
//cleared when changing the configuration.
|
//cleared when changing the configuration.
|
||||||
preparePutToStoreMap.putIfAbsent(e.getKey(), new AtomicInteger());
|
int preparePutCount = preparePutToStoreMap
|
||||||
AtomicInteger preparePutCounter = preparePutToStoreMap.get(e.getKey());
|
.computeIfAbsent(e.getKey(), key -> new AtomicInteger())
|
||||||
if (preparePutCounter == null) {
|
.incrementAndGet();
|
||||||
preparePutCounter = new AtomicInteger();
|
boolean storeAboveThread =
|
||||||
preparePutToStoreMap.putIfAbsent(e.getKey(), preparePutCounter);
|
store.getCurrentParallelPutCount() > this.parallelPutToStoreThreadLimit;
|
||||||
}
|
boolean storeAbovePrePut = preparePutCount > this.parallelPreparePutToStoreThreadLimit;
|
||||||
int preparePutCount = preparePutCounter.incrementAndGet();
|
if (storeAboveThread || storeAbovePrePut) {
|
||||||
if (store.getCurrentParallelPutCount() > this.parallelPutToStoreThreadLimit
|
|
||||||
|| preparePutCount > this.parallelPreparePutToStoreThreadLimit) {
|
|
||||||
tooBusyStore = (tooBusyStore == null ?
|
tooBusyStore = (tooBusyStore == null ?
|
||||||
store.getColumnFamilyName() :
|
store.getColumnFamilyName() :
|
||||||
tooBusyStore + "," + store.getColumnFamilyName());
|
tooBusyStore + "," + store.getColumnFamilyName());
|
||||||
}
|
}
|
||||||
|
aboveParallelThreadLimit |= storeAboveThread;
|
||||||
|
aboveParallelPrePutLimit |= storeAbovePrePut;
|
||||||
|
|
||||||
if (LOG.isTraceEnabled()) {
|
if (LOG.isTraceEnabled()) {
|
||||||
LOG.trace(store.getColumnFamilyName() + ": preparePutCount=" + preparePutCount
|
LOG.trace(store.getColumnFamilyName() + ": preparePutCount=" + preparePutCount
|
||||||
|
@ -140,13 +142,16 @@ public class StoreHotnessProtector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tooBusyStore != null) {
|
if (aboveParallelThreadLimit || aboveParallelPrePutLimit) {
|
||||||
String msg =
|
String msg =
|
||||||
"StoreTooBusy," + this.region.getRegionInfo().getRegionNameAsString() + ":" + tooBusyStore
|
"StoreTooBusy," + this.region.getRegionInfo().getRegionNameAsString() + ":" + tooBusyStore
|
||||||
+ " Above parallelPutToStoreThreadLimit(" + this.parallelPutToStoreThreadLimit + ")";
|
+ " Above "
|
||||||
if (LOG.isTraceEnabled()) {
|
+ (aboveParallelThreadLimit ? "parallelPutToStoreThreadLimit("
|
||||||
|
+ this.parallelPutToStoreThreadLimit + ")" : "")
|
||||||
|
+ (aboveParallelThreadLimit && aboveParallelPrePutLimit ? " or " : "")
|
||||||
|
+ (aboveParallelPrePutLimit ? "parallelPreparePutToStoreThreadLimit("
|
||||||
|
+ this.parallelPreparePutToStoreThreadLimit + ")" : "");
|
||||||
LOG.trace(msg);
|
LOG.trace(msg);
|
||||||
}
|
|
||||||
throw new RegionTooBusyException(msg);
|
throw new RegionTooBusyException(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue