HBASE-25634 The client frequently exceeds the quota, which causes the meta table scan to be too high

This commit is contained in:
zhengsicheng 2021-04-30 18:10:15 +08:00
parent c52c091609
commit 8b3dc69362
2 changed files with 12 additions and 1 deletions

View File

@ -73,6 +73,10 @@ public class RetriesExhaustedException extends IOException {
}
return joiner.toString();
}
public Throwable getThrowable() {
return throwable;
}
}
/**

View File

@ -33,6 +33,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.hadoop.hbase.CallQueueTooBigException;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.exceptions.PreemptiveFastFailException;
import org.apache.hadoop.hbase.quotas.RpcThrottlingException;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import org.apache.hadoop.hbase.util.ExceptionUtil;
import org.apache.hadoop.ipc.RemoteException;
@ -103,7 +104,13 @@ public class RpcRetryingCallerImpl<T> implements RpcRetryingCaller<T> {
long expectedSleep;
try {
// bad cache entries are cleared in the call to RetryingCallable#throwable() in catch block
callable.prepare(tries != 0);
Throwable t = null;
if (exceptions != null && !exceptions.isEmpty()) {
t = exceptions.get(exceptions.size() - 1).getThrowable();
}
if (!(t instanceof RpcThrottlingException)) {
callable.prepare(tries != 0);
}
interceptor.intercept(context.prepare(callable, tries));
return callable.call(getTimeout(callTimeout));
} catch (PreemptiveFastFailException e) {