From 3bba9239ef3ae89fa32ea8eeda18e7c177062274 Mon Sep 17 00:00:00 2001 From: Bhupendra Date: Fri, 6 Nov 2015 16:12:41 +0530 Subject: [PATCH] HBASE-14777: Replication fails with IndexOutOfBoundsException --- .../regionserver/HBaseInterClusterReplicationEndpoint.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java index 4c719a9..0210157 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java @@ -206,11 +206,12 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi } } IOException iox = null; - for (Future f : futures) { + int fLen = futures.size(); + for (int fIndex = fLen - 1; fIndex >= 0; fIndex--) { try { // wait for all futures, remove successful parts // (only the remaining parts will be retried) - entryLists.remove(f.get()); + entryLists.remove(futures.get(fIndex).get()); } catch (InterruptedException ie) { iox = new IOException(ie); } catch (ExecutionException ee) { -- 1.8.4.msysgit.0