HBASE-2358 Store doReconstructionLog will fail if oldlogfile.log is empty and won't load region

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@926353 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-03-22 21:36:17 +00:00
parent ee70585289
commit 0d1bbc6c51
2 changed files with 7 additions and 4 deletions

View File

@ -250,6 +250,8 @@ Release 0.21.0 - Unreleased
HBASE-2283 row level atomicity (Kannan Muthukkaruppan via Stack)
HBASE-2355 Unsynchronized logWriters map is mutated from several threads in
HLog splitting (Todd Lipcon via Andrew Purtell)
HBASE-2358 Store doReconstructionLog will fail if oldlogfile.log is empty
and won't load region (Cosmin Lehene via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -306,13 +306,14 @@ public class Store implements HConstants, HeapSize {
// Nothing to do.
return -1;
}
// Check its not empty.
FileStatus [] stats = this.fs.listStatus(reconstructionLog);
if (stats == null || stats.length == 0) {
FileStatus stat = this.fs.getFileStatus(reconstructionLog);
if (stat.getLen() <= 0) {
LOG.warn("Passed reconstruction log " + reconstructionLog +
" is zero-length");
" is zero-length. Deleting existing file");
fs.delete(reconstructionLog, false);
return -1;
}
// TODO: This could grow large and blow heap out. Need to get it into
// general memory usage accounting.
long maxSeqIdInLog = -1;