This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git
commit 6f79550c5295c2f2bb4e0314551b51f6b7b64834 Author: zhangduo <[email protected]> AuthorDate: Wed Apr 24 22:56:14 2019 +0800 HBASE-22303 Fix TestReplicationDroppedTables --- .../hadoop/hbase/client/AsyncRegionServerAdmin.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionServerAdmin.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionServerAdmin.java index bbbcdf2..7a591ac 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionServerAdmin.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionServerAdmin.java @@ -96,6 +96,11 @@ public class AsyncRegionServerAdmin { } private <RESP> CompletableFuture<RESP> call(RpcCall<RESP> rpcCall, CellScanner cellScanner) { + return call(rpcCall, cellScanner, true); + } + + private <RESP> CompletableFuture<RESP> call(RpcCall<RESP> rpcCall, CellScanner cellScanner, + boolean translateException) { CompletableFuture<RESP> future = new CompletableFuture<>(); HBaseRpcController controller = conn.rpcControllerFactory.newController(cellScanner); try { @@ -104,8 +109,10 @@ public class AsyncRegionServerAdmin { @Override public void run(RESP resp) { if (controller.failed()) { - future - .completeExceptionally(ConnectionUtils.translateException(controller.getFailed())); + Throwable error = + translateException ? ConnectionUtils.translateException(controller.getFailed()) + : controller.getFailed(); + future.completeExceptionally(error); } else { future.complete(resp); } @@ -161,8 +168,10 @@ public class AsyncRegionServerAdmin { public CompletableFuture<ReplicateWALEntryResponse> replicateWALEntry( ReplicateWALEntryRequest request, CellScanner cellScanner) { + // The retry logic in upper layer needs to know whether the exception is constructed at remote + // side or local side, so we do not translate the exception here. return call((stub, controller, done) -> stub.replicateWALEntry(controller, request, done), - cellScanner); + cellScanner, false); } public CompletableFuture<ReplicateWALEntryResponse> replay(ReplicateWALEntryRequest request,
