Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-26580 The message of StoreTooBusy is confused #3949

Merged
merged 2 commits into from
Dec 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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