HBASE-529 RegionServer needs to recover if datanode goes down

-HLog will now try to reopen the log twice on append failure before taking the region server down

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@638597 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bryan Duxbury 2008-03-18 21:44:02 +00:00
parent ea1ac1f75c
commit f66e157e5e
2 changed files with 14 additions and 1 deletions

View File

@ -93,6 +93,7 @@ Hbase Change Log
HBASE-477 Add support for an HBASE_CLASSPATH
HBASE-443 Move internal classes out of HStore
HBASE-515 At least double default timeouts between regionserver and master
HBASE-529 RegionServer needs to recover if datanode goes down
Branch 0.1

View File

@ -383,7 +383,19 @@ public class HLog implements HConstants {
new HLogKey(regionName, tableName, key.getRow(), seqNum[counter++]);
HLogEdit logEdit =
new HLogEdit(key.getColumn(), es.getValue(), key.getTimestamp());
this.writer.append(logKey, logEdit);
try {
this.writer.append(logKey, logEdit);
} catch (IOException e) {
LOG.error("Could not append to log. Opening new log. Exception: ", e);
rollWriter();
try {
this.writer.append(logKey, logEdit);
} catch (IOException e2) {
LOG.fatal("Could not append to log the second time because " +
e2.toString() + ", aborting.");
throw e2;
}
}
this.numEntries++;
}
}