Index: src/java/org/apache/hadoop/hbase/HLog.java =================================================================== --- src/java/org/apache/hadoop/hbase/HLog.java (revision 671642) +++ src/java/org/apache/hadoop/hbase/HLog.java (working copy) @@ -362,8 +362,8 @@ * @throws IOException */ void append(Text regionName, Text tableName, - TreeMap edits) throws IOException { - + TreeMap edits) + throws IOException { if (closed) { throw new IOException("Cannot append; log is closed"); } @@ -386,26 +386,24 @@ try { this.writer.append(logKey, logEdit); } catch (IOException e) { - LOG.error("Could not append to log. Opening new log. Exception: ", e); - rollWriter(); - try { - this.writer.append(logKey, logEdit); - } catch (IOException e2) { - LOG.fatal("Could not append to log the second time because " + - e2.toString() + ", aborting."); - throw e2; - } + LOG.fatal("Could not append. Requesting close of log", e); + requestLogRoll(); + throw e; } this.numEntries++; } } if (this.numEntries > this.maxlogentries) { - if (listener != null) { - listener.logRollRequested(); - } + requestLogRoll(); } } + private void requestLogRoll() { + if (this.listener != null) { + this.listener.logRollRequested(); + } + } + /** @return How many items have been added to the log */ int getNumEntries() { return numEntries;