diff --git a/CHANGES.txt b/CHANGES.txt index 596c652bf4f..515a85b9eca 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -105,6 +105,7 @@ Hbase Change Log HBASE-529 RegionServer needs to recover if datanode goes down HBASE-456 Clearly state which ports need to be opened in order to run HBase HBASE-536 Remove MiniDFS startup from MiniHBaseCluster + HBASE-521 Improve client scanner interface Branch 0.1 diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HStore.java b/src/java/org/apache/hadoop/hbase/regionserver/HStore.java index d42d90bc3d4..03a9eaf8bca 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HStore.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HStore.java @@ -44,6 +44,7 @@ import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.filter.RowFilterInterface; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; @@ -206,10 +207,7 @@ public class HStore implements HConstants { } if(LOG.isDebugEnabled()) { - LOG.debug("starting " + storeName + - ((reconstructionLog == null || !fs.exists(reconstructionLog)) ? - " (no reconstruction log)" : - " with reconstruction log: " + reconstructionLog.toString())); + LOG.debug("starting " + storeName); } // Go through the 'mapdir' and 'infodir' together, make sure that all @@ -236,7 +234,16 @@ public class HStore implements HConstants { this.maxSeqId); } - doReconstructionLog(reconstructionLog, maxSeqId); + try { + doReconstructionLog(reconstructionLog, maxSeqId); + } catch (IOException e) { + // Presume we got here because of some HDFS issue or because of a lack of + // HADOOP-1700; for now keep going but this is probably not what we want + // long term. If we got here there has been data-loss + LOG.warn("Exception processing reconstruction log " + reconstructionLog + + " opening " + this.storeName + + " -- continuing. Probably DATA LOSS!", e); + } // By default, we compact if an HStore has more than // MIN_COMMITS_FOR_COMPACTION map files @@ -303,11 +310,16 @@ public class HStore implements HConstants { private void doReconstructionLog(final Path reconstructionLog, final long maxSeqID) throws UnsupportedEncodingException, IOException { - if (reconstructionLog == null || !fs.exists(reconstructionLog)) { // Nothing to do. return; } + // Check its not empty. + FileStatus[] stats = fs.listStatus(reconstructionLog); + if (stats == null || stats.length == 0) { + LOG.warn("Passed reconstruction log " + reconstructionLog + " is zero-length"); + return; + } long maxSeqIdInLog = -1; TreeMap reconstructedCache = new TreeMap(); @@ -1691,4 +1703,4 @@ public class HStore implements HConstants { } } } -} \ No newline at end of file +}