Index: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java (revision 1393833) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java (working copy) @@ -510,12 +510,6 @@ if (nextWriter instanceof SequenceFileLogWriter) { nextHdfsOut = ((SequenceFileLogWriter)nextWriter).getWriterFSDataOutputStream(); } - // Tell our listeners that a new log was created - if (!this.listeners.isEmpty()) { - for (WALActionsListener i : this.listeners) { - i.postLogRoll(oldPath, newPath); - } - } synchronized (updateLock) { // Clean up current writer. @@ -531,6 +525,13 @@ " for " + FSUtils.getPath(newPath)); this.numEntries.set(0); } + // Tell our listeners that a new log was created + if (!this.listeners.isEmpty()) { + for (WALActionsListener i : this.listeners) { + i.postLogRoll(oldPath, newPath); + } + } + // Can we delete any of the old log files? if (this.outputfiles.size() > 0) { if (this.lastSeqWritten.isEmpty()) { Index: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java (revision 1393833) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java (working copy) @@ -252,7 +252,7 @@ return this.sources; } - void logRolled(Path newLog) throws IOException { + void prelogRoll(Path newLog) throws IOException { if (!this.replicating.get()) { LOG.warn("Replication stopped, won't add new log"); return; @@ -278,6 +278,14 @@ } this.latestPath = newLog; + } + + void postlogRoll(Path newLog) throws IOException { + if (!this.replicating.get()) { + LOG.warn("Replication stopped, won't add new log"); + return; + } + // This only updates the sources we own, not the recovered ones for (ReplicationSourceInterface source : this.sources) { source.enqueueLog(newLog); Index: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/Replication.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/Replication.java (revision 1393833) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/Replication.java (working copy) @@ -189,12 +189,12 @@ @Override public void preLogRoll(Path oldPath, Path newPath) throws IOException { - // Not interested + getReplicationManager().prelogRoll(newPath); } @Override public void postLogRoll(Path oldPath, Path newPath) throws IOException { - getReplicationManager().logRolled(newPath); + getReplicationManager().postlogRoll(newPath); } @Override