HBASE-19647 Logging cleanups; emit regionname when RegionTooBusyException inside RetriesExhausted... make netty connect/disconnect TRACE-level; ADDENDUM

This commit is contained in:
Michael Stack 2017-12-27 14:14:07 -08:00
parent 7dee1bcd31
commit e4ab29ada2
5 changed files with 19 additions and 17 deletions

View File

@ -24,21 +24,20 @@ import org.apache.yetus.audience.InterfaceAudience;
/**
* Thrown by a region server if it will block and wait to serve a request.
* For example, the client wants to insert something to a region while the
* region is compacting.
* region is compacting. Keep variance in the passed 'msg' low because its msg is used as a key
* over in {@link org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException}
* grouping failure types.
*/
@InterfaceAudience.Public
public class RegionTooBusyException extends IOException {
private static final long serialVersionUID = 1728345723728342L;
/** default constructor */
public RegionTooBusyException() {
super();
}
/**
* Constructor
* @param msg message
*/
// Be careful. Keep variance in the passed 'msg' low because its msg is used as a key over in
// RetriesExhaustedWithDetailsException grouping failure types.
public RegionTooBusyException(final String msg) {
super(msg);
}

View File

@ -157,6 +157,8 @@ extends RetriesExhaustedException {
if (t instanceof DoNotRetryIOException ||
t instanceof RegionTooBusyException) {
// If RegionTooBusyException, print message since it has Region name in it.
// RegionTooBusyException message was edited to remove variance. Has regionname, server,
// and why the exception; no longer has duration it waited on lock nor current memsize.
name = t.getMessage();
} else {
name = t.getClass().getSimpleName();

View File

@ -4170,12 +4170,12 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
if (this.memstoreDataSize.get() > this.blockingMemStoreSize) {
blockedRequestsCount.increment();
requestFlush();
throw new RegionTooBusyException("Over memstore limit, " +
"regionName=" + (this.getRegionInfo() == null ? "unknown" :
this.getRegionInfo().getRegionNameAsString()) +
", server=" + (this.getRegionServerServices() == null ? "unknown" :
// Don't print current limit because it will vary too much. The message is used as a key
// over in RetriesExhaustedWithDetailsException processing.
throw new RegionTooBusyException("Over memstore limit; regionName=" +
(this.getRegionInfo() == null? "unknown": this.getRegionInfo().getRegionNameAsString()) +
", server=" + (this.getRegionServerServices() == null ? "unknown":
this.getRegionServerServices().getServerName()) +
", memstoreSize=" + memstoreDataSize.get() +
", blockingMemStoreSize=" + blockingMemStoreSize);
}
}
@ -8183,11 +8183,12 @@ 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" :
// Don't print millis. Message is used as a key over in
// RetriesExhaustedWithDetailsException processing.
throw new RegionTooBusyException("Failed to obtain lock; regionName=" +
(this.getRegionInfo() == null? "unknown":
this.getRegionInfo().getRegionNameAsString()) +
", server=" + (this.getRegionServerServices() == null ? "unknown" :
", server=" + (this.getRegionServerServices() == null? "unknown":
this.getRegionServerServices().getServerName()));
}
} catch (InterruptedException ie) {

View File

@ -187,7 +187,7 @@ public class TestMetaCache {
public static List<Throwable> metaCachePreservingExceptions() {
return new ArrayList<Throwable>() {{
add(new RegionOpeningException(" "));
add(new RegionTooBusyException());
add(new RegionTooBusyException("Some old message"));
add(new ThrottlingException(" "));
add(new MultiActionResultTooLarge(" "));
add(new RetryImmediatelyException(" "));

View File

@ -133,7 +133,7 @@ public class TestRpcMetrics {
HELPER.assertCounter("exceptions", 1, serverSource);
mrpc.exception(new RegionMovedException(ServerName.parseServerName("localhost:60020"), 100));
mrpc.exception(new RegionTooBusyException());
mrpc.exception(new RegionTooBusyException("Some region"));
mrpc.exception(new OutOfOrderScannerNextException());
mrpc.exception(new NotServingRegionException());
HELPER.assertCounter("exceptions.RegionMovedException", 1, serverSource);