diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationHLogReaderManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationHLogReaderManager.java index 5a4363696cc..4ea518e361f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationHLogReaderManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationHLogReaderManager.java @@ -123,15 +123,20 @@ public class ReplicationHLogReaderManager { public void closeReader() throws IOException { if (this.reader != null) { this.reader.close(); + this.reader = null; } } /** * Tell the helper to reset internal state */ - public void finishCurrentFile() { + void finishCurrentFile() { this.position = 0; - this.reader = null; + try { + this.closeReader(); + } catch (IOException e) { + LOG.warn("Unable to close reader", e); + } } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java index 8910a7eb68f..c5bc614f8d8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java @@ -327,6 +327,7 @@ public class ReplicationSource extends Thread } boolean gotIOE = false; + currentNbOperations = 0; currentNbEntries = 0; currentSize = 0; try {