Index: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java (revision 1381065) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java (working copy) @@ -538,7 +538,27 @@ // TODO without scanning all logs dir if (sleepMultiplier == this.maxRetriesMultiplier) { LOG.warn("Waited too long for this file, considering dumping"); - return !processEndOfFile(); + + FileStatus stat = null; + try { + stat = this.fs.getFileStatus(this.currentPath); + } catch (IOException e) { + LOG.fatal("Retry too many times on open hlog "+ this.currentPath.getName() + +" Please check hlog status or HDFS .", e); + return false; + } + if(stat == null){ + LOG.fatal("Retry too many times on open hlog "+ this.currentPath.getName() + +" Please check hlog status or HDFS .", ioe); + return false; + } + if(stat.getLen() == 0){ + return !processEndOfFile(); + }else{ + LOG.fatal("Retry too many times on open hlog "+ this.currentPath.getName() + +" Please check hlog status or HDFS .", ioe); + return false; + } } } return true;