HBASE-25004 : Log RegionTooBusyException details (#2371)

Signed-off-by: mnpoonia <apoonia@salesforce.com>
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Viraj Jasani 2020-09-10 21:22:37 +05:30
parent 624fd046ce
commit c8d6d7a780
No known key found for this signature in database
GPG Key ID: B3D6C0B41C8ADFD5
1 changed files with 21 additions and 13 deletions

View File

@ -4070,13 +4070,17 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
if (this.memstoreSize.get() > this.blockingMemStoreSize) {
blockedRequestsCount.increment();
requestFlush();
throw new RegionTooBusyException("Above memstore limit, " +
"regionName=" + (this.getRegionInfo() == null ? "unknown" :
this.getRegionInfo().getRegionNameAsString()) +
", server=" + (this.getRegionServerServices() == null ? "unknown" :
this.getRegionServerServices().getServerName()) +
", memstoreSize=" + memstoreSize.get() +
", blockingMemStoreSize=" + blockingMemStoreSize);
final String regionName =
this.getRegionInfo() == null ? "unknown" : this.getRegionInfo().getRegionNameAsString();
final String serverName = this.getRegionServerServices() == null ?
"unknown" : (this.getRegionServerServices().getServerName() == null ? "unknown" :
this.getRegionServerServices().getServerName().toString());
RegionTooBusyException rtbe = new RegionTooBusyException(
"Above memstore limit, " + "regionName=" + regionName + ", server=" + serverName
+ ", memstoreSize=" + memstoreSize.get()
+ ", blockingMemStoreSize=" + blockingMemStoreSize);
LOG.warn("Region is too busy due to exceeding memstore size limit.", rtbe);
throw rtbe;
}
}
@ -8853,12 +8857,16 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
final long waitTime = Math.min(maxBusyWaitDuration,
busyWaitDuration * Math.min(multiplier, maxBusyWaitMultiplier));
if (!lock.tryLock(waitTime, TimeUnit.MILLISECONDS)) {
throw new RegionTooBusyException(
"failed to get a lock in " + waitTime + " ms. " +
"regionName=" + (this.getRegionInfo() == null ? "unknown" :
this.getRegionInfo().getRegionNameAsString()) +
", server=" + (this.getRegionServerServices() == null ? "unknown" :
this.getRegionServerServices().getServerName()));
final String regionName =
this.getRegionInfo() == null ? "unknown" : this.getRegionInfo().getRegionNameAsString();
final String serverName = this.getRegionServerServices() == null ? "unknown" :
(this.getRegionServerServices().getServerName() == null ? "unknown" :
this.getRegionServerServices().getServerName().toString());
RegionTooBusyException rtbe = new RegionTooBusyException(
"failed to get a lock in " + waitTime + " ms. " + "regionName=" + regionName + ", server="
+ serverName);
LOG.warn("Region is too busy to allow lock acquisition.", rtbe);
throw rtbe;
}
} catch (InterruptedException ie) {
LOG.info("Interrupted while waiting for a lock");