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" different address/startcode than SCAN"
HBASE-2361 WALEdit broke replication scope HBASE-2361 WALEdit broke replication scope
HBASE-2365 Double-assignment around split HBASE-2365 Double-assignment around split
HBASE-2398 NPE in HLog.append when calling writer.getLength
(Kannan Muthukkaruppan via Stack)
IMPROVEMENTS IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable HBASE-1760 Cleanup TODOs in HTable

View File

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