HBASE-24282 'scanDetail' log message is missing when responseTooSlow happens on the first scan rpc call (#1604)
Signed-off-by: Guangxu Cheng <gxcheng@apache.org> Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
13f36d9db3
commit
856e21d199
|
@ -504,12 +504,15 @@ public abstract class RpcServer implements RpcServerInterface,
|
||||||
responseInfo.put("param", stringifiedParam);
|
responseInfo.put("param", stringifiedParam);
|
||||||
if (param instanceof ClientProtos.ScanRequest && rsRpcServices != null) {
|
if (param instanceof ClientProtos.ScanRequest && rsRpcServices != null) {
|
||||||
ClientProtos.ScanRequest request = ((ClientProtos.ScanRequest) param);
|
ClientProtos.ScanRequest request = ((ClientProtos.ScanRequest) param);
|
||||||
|
String scanDetails;
|
||||||
if (request.hasScannerId()) {
|
if (request.hasScannerId()) {
|
||||||
long scannerId = request.getScannerId();
|
long scannerId = request.getScannerId();
|
||||||
String scanDetails = rsRpcServices.getScanDetailsWithId(scannerId);
|
scanDetails = rsRpcServices.getScanDetailsWithId(scannerId);
|
||||||
if (scanDetails != null) {
|
} else {
|
||||||
responseInfo.put("scandetails", scanDetails);
|
scanDetails = rsRpcServices.getScanDetailsWithRequest(request);
|
||||||
}
|
}
|
||||||
|
if (scanDetails != null) {
|
||||||
|
responseInfo.put("scandetails", scanDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (param instanceof ClientProtos.MultiRequest) {
|
if (param instanceof ClientProtos.MultiRequest) {
|
||||||
|
|
|
@ -1380,6 +1380,21 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getScanDetailsWithRequest(ScanRequest request) {
|
||||||
|
try {
|
||||||
|
if (!request.hasRegion()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Region region = getRegion(request.getRegion());
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("table: ").append(region.getRegionInfo().getTable().getNameAsString());
|
||||||
|
builder.append(" region: ").append(region.getRegionInfo().getRegionNameAsString());
|
||||||
|
return builder.toString();
|
||||||
|
} catch (IOException ignored) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the vtime associated with the scanner.
|
* Get the vtime associated with the scanner.
|
||||||
* Currently the vtime is the number of "next" calls.
|
* Currently the vtime is the number of "next" calls.
|
||||||
|
|
Loading…
Reference in New Issue