diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java index d68668b..e1531e6 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java @@ -745,10 +745,21 @@ class AsyncProcess { private void receiveGlobalFailure(List> initialActions, MultiAction rsActions, HRegionLocation location, int numAttempt, Throwable t, HConnectionManager.ServerErrorTracker errorsByServer) { - // Do not use the exception for updating cache because it might be coming from - // any of the regions in the MultiAction. - hConnection.updateCachedLocations(tableName, - rsActions.actions.values().iterator().next().get(0).getAction().getRow(), null, location); + int count = 0; + Iterator>> iter = rsActions.actions.values().iterator(); + while (iter.hasNext()) { + List> actions = iter.next(); + if (!actions.isEmpty()) { + // Do not use the exception for updating cache because it might be coming from + // any of the regions in the MultiAction. + hConnection.updateCachedLocations(tableName, actions.get(0).getAction().getRow(), null, + location); + count++; + } + } + + LOG.debug("update all cached locations (" + count + "): " + location); + errorsByServer.reportServerError(location); boolean canRetry = errorsByServer.canRetryMore(numAttempt);