From c6cabe7a77d714d04365c3884ec81a439540c7b8 Mon Sep 17 00:00:00 2001 From: Guanghao Zhang Date: Wed, 27 Dec 2017 17:39:52 +0800 Subject: [PATCH] HBASE-19643 Need to update cache location when get error in AsyncBatchRpcRetryingCaller --- .../org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java index 7249435..8d59130 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java @@ -262,6 +262,7 @@ class AsyncBatchRpcRetryingCaller { } else if (result instanceof Throwable) { Throwable error = translateException((Throwable) result); logException(tries, () -> Stream.of(regionReq), error, serverName); + conn.getLocator().updateCachedLocation(regionReq.loc, error); if (error instanceof DoNotRetryIOException || tries >= maxAttempts) { failOne(action, tries, error, EnvironmentEdgeManager.currentTime(), getExtraContextForError(serverName)); @@ -364,6 +365,8 @@ class AsyncBatchRpcRetryingCaller { ServerName serverName) { Throwable error = translateException(t); logException(tries, () -> actionsByRegion.values().stream(), error, serverName); + actionsByRegion + .forEach((rn, regionReq) -> conn.getLocator().updateCachedLocation(regionReq.loc, error)); if (error instanceof DoNotRetryIOException || tries >= maxAttempts) { failAll(actionsByRegion.values().stream().flatMap(r -> r.actions.stream()), tries, error, serverName); -- 1.9.1