HBASE-864 Deadlock in regionserver

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@691710 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-09-03 18:17:19 +00:00
parent 65852deff9
commit d49952f979
2 changed files with 28 additions and 26 deletions

View File

@ -55,6 +55,7 @@ Release 0.18.0 - Unreleased
(Billy Pearson via Stack)
HBASE-832 Problem with row keys beginnig with characters < than ',' and
the region location cache
HBASE-864 Deadlock in regionserver
IMPROVEMENTS
HBASE-801 When a table haven't disable, shell could response in a "user

View File

@ -166,33 +166,34 @@ class Flusher extends Thread implements FlushRequester {
flushQueue.remove(region);
}
lock.lock();
try {
// See comment above for removeFromQueue on why we do not
// compact if removeFromQueue is true. Note that region.flushCache()
// only returns true if a flush is done and if a compaction is needed.
if (region.flushcache() && !removeFromQueue) {
server.compactSplitThread.compactionRequested(region);
}
} catch (DroppedSnapshotException ex) {
// Cache flush can fail in a few places. If it fails in a critical
// section, we get a DroppedSnapshotException and a replay of hlog
// is required. Currently the only way to do this is a restart of
// the server. Abort because hdfs is probably bad (HBASE-644 is a case
// where hdfs was bad but passed the hdfs check).
LOG.fatal("Replay of hlog required. Forcing server restart", ex);
server.abort();
return false;
} catch (IOException ex) {
LOG.error("Cache flush failed" +
(region != null ? (" for region " + region.getRegionName()) : ""),
RemoteExceptionHandler.checkIOException(ex));
if (!server.checkFileSystem()) {
return false;
}
} finally {
lock.unlock();
}
}
try {
// See comment above for removeFromQueue on why we do not
// compact if removeFromQueue is true. Note that region.flushCache()
// only returns true if a flush is done and if a compaction is needed.
if (region.flushcache() && !removeFromQueue) {
server.compactSplitThread.compactionRequested(region);
}
} catch (DroppedSnapshotException ex) {
// Cache flush can fail in a few places. If it fails in a critical
// section, we get a DroppedSnapshotException and a replay of hlog
// is required. Currently the only way to do this is a restart of
// the server. Abort because hdfs is probably bad (HBASE-644 is a case
// where hdfs was bad but passed the hdfs check).
LOG.fatal("Replay of hlog required. Forcing server restart", ex);
server.abort();
return false;
} catch (IOException ex) {
LOG.error("Cache flush failed"
+ (region != null ? (" for region " + region.getRegionName()) : ""),
RemoteExceptionHandler.checkIOException(ex));
if (!server.checkFileSystem()) {
return false;
}
} finally {
lock.unlock();
}
return true;
}