HBASE-2398 NPE in HLog.append when calling writer.getLength

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@930129 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-04-01 23:00:20 +00:00
parent 4cbfa4b594
commit 4503dbe136
2 changed files with 8 additions and 9 deletions

View File

@ -261,6 +261,8 @@ Release 0.21.0 - Unreleased
different address/startcode than SCAN"
HBASE-2361 WALEdit broke replication scope
HBASE-2365 Double-assignment around split
HBASE-2398 NPE in HLog.append when calling writer.getLength
(Kannan Muthukkaruppan via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -673,12 +673,6 @@ public class HLog implements HConstants, Syncable {
// sync txn to file system
this.sync(isMetaRegion);
if (this.writer.getLength() > this.logrollsize) {
if (listener != null) {
listener.logRollRequested();
}
}
}
/**
@ -729,9 +723,6 @@ public class HLog implements HConstants, Syncable {
}
// sync txn to file system
this.sync(info.isMetaRegion());
if (this.writer.getLength() > this.logrollsize) {
requestLogRoll();
}
}
/**
@ -840,6 +831,7 @@ public class HLog implements HConstants, Syncable {
if (this.closed) {
return;
}
boolean logRollRequested = false;
if (this.forceSync ||
this.unflushedEntries.get() >= this.flushlogentries) {
try {
@ -849,12 +841,17 @@ public class HLog implements HConstants, Syncable {
syncOps++;
this.forceSync = false;
this.unflushedEntries.set(0);
// TODO: HBASE-2401
} catch (IOException e) {
LOG.fatal("Could not append. Requesting close of hlog", e);
requestLogRoll();
throw e;
}
}
if (!logRollRequested && (this.writer.getLength() > this.logrollsize)) {
requestLogRoll();
}
}
}