Index: src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java (revision 9338) +++ src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java (working copy) @@ -30,6 +30,7 @@ import java.io.UnsupportedEncodingException; import java.lang.reflect.Method; import java.net.URLEncoder; +import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -1313,13 +1314,20 @@ LOG.warn("EOF from hlog " + logPath + ". continuing"); processedLogs.add(logPath); } catch (IOException e) { - if (skipErrors) { - LOG.info("Got while parsing hlog " + logPath + - ". Marking as corrupted", e); - corruptedLogs.add(logPath); - } else { - throw e; - } + // If the IOE resulted from bad file format, + // then this problem is idempotent and retrying won't help + if (e.getCause() instanceof ParseException) { + LOG.warn("ParseException from hlog " + logPath + ". continuing"); + processedLogs.add(logPath); + } else { + if (skipErrors) { + LOG.info("Got while parsing hlog " + logPath + + ". Marking as corrupted", e); + corruptedLogs.add(logPath); + } else { + throw e; + } + } } } writeEditsBatchToRegions(editsByRegion, logWriters, rootDir, fs, conf); Index: src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (revision 9338) +++ src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (working copy) @@ -24,6 +24,7 @@ import java.io.InterruptedIOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Constructor; +import java.text.ParseException; import java.util.AbstractList; import java.util.ArrayList; import java.util.Arrays; @@ -2032,11 +2033,15 @@ "log spliting, so we have this data in another edit. " + "Continuing, but renaming " + edits + " as " + p, eof); } catch (IOException ioe) { - if (ioe.getMessage().startsWith("File is corrupt")) { + // If the IOE resulted from bad file format, + // then this problem is idempotent and retrying won't help + if (ioe.getCause() instanceof ParseException) { Path p = HLog.moveAsideBadEditsFile(fs, edits); LOG.warn("File corruption encountered! " + "Continuing, but renaming " + edits + " as " + p, ioe); } else { + // other IO errors may be transient (bad network connection, + // checksum exception on one datanode, etc). throw & retry throw ioe; } }