Index: src/java/org/apache/hadoop/hbase/regionserver/HLog.java =================================================================== --- src/java/org/apache/hadoop/hbase/regionserver/HLog.java (revision 5626) +++ src/java/org/apache/hadoop/hbase/regionserver/HLog.java (working copy) @@ -685,12 +685,6 @@ // sync txn to file system this.sync(isMetaRegion); - - if (this.writer.getLength() > this.logrollsize) { - if (listener != null) { - listener.logRollRequested(); - } - } } /** @@ -744,10 +738,6 @@ // sync txn to file system this.sync(isMetaRegion); - - if (this.writer.getLength() > this.logrollsize) { - requestLogRoll(); - } } /** @@ -857,6 +847,8 @@ return; } + boolean logRollRequested = false; + if (this.forceSync || this.unflushedEntries.get() >= this.flushlogentries) { try { @@ -884,7 +876,8 @@ "Found " + numCurrentReplicas + " replicas but expecting " + fs.getDefaultReplication() + " replicas. " + " Requesting close of hlog."); - requestLogRoll(); + requestLogRoll(); + logRollRequested = true; } } catch (Exception e) { LOG.warn("Unable to invoke DFSOutputStream.getNumCurrentReplicas" + e + @@ -896,6 +889,10 @@ throw e; } } + + if (!logRollRequested && (this.writer.getLength() > this.logrollsize)) { + requestLogRoll(); + } } }