[ https://issues.apache.org/jira/browse/HBASE-14777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993479#comment-14993479 ]
Bhupendra Kumar Jain commented on HBASE-14777: ---------------------------------------------- The code removes the successful entries from the list of entries. Each removal from the list changes the position of subsequent element of list which results in IndexOutOfBoundsException {code} for (Future<Integer> f : futures) { try { // wait for all futures, remove successful parts // (only the remaining parts will be retried) entryLists.remove(f.get()); } catch (InterruptedException ie) { iox = new IOException(ie); } {code} To handle this, We can iterate and remove in reverse order. {code} 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(futures.get(fIndex).get()); } catch (InterruptedException ie) { iox = new IOException(ie); } {code} > Replication fails with IndexOutOfBoundsException > ------------------------------------------------ > > Key: HBASE-14777 > URL: https://issues.apache.org/jira/browse/HBASE-14777 > Project: HBase > Issue Type: Bug > Components: Replication > Affects Versions: 2.0.0, 1.2.0, 1.3.0 > Reporter: Bhupendra Kumar Jain > Assignee: Bhupendra Kumar Jain > Priority: Critical > > Replication fails with IndexOutOfBoundsException > {code} > regionserver.ReplicationSource$ReplicationSourceWorkerThread(939): > org.apache.hadoop.hbase.replication.regionserver.HBaseInterClusterReplicationEndpoint > threw unknown exception:java.lang.IndexOutOfBoundsException: Index: 1, Size: > 1 > at java.util.ArrayList.rangeCheck(Unknown Source) > at java.util.ArrayList.remove(Unknown Source) > at > org.apache.hadoop.hbase.replication.regionserver.HBaseInterClusterReplicationEndpoint.replicate(HBaseInterClusterReplicationEndpoint.java:222) > {code} > Its happening due to incorrect removal of entries from the replication > entries list. -- This message was sent by Atlassian JIRA (v6.3.4#6332)