HBASE-2447 LogSyncer.addToSyncQueue doesn't check if syncer is still running before waiting

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@937589 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-04-24 04:24:53 +00:00
parent c39d8f341a
commit 1982339473
3 changed files with 17 additions and 2 deletions

View File

@ -283,6 +283,8 @@ Release 0.21.0 - Unreleased
(Benoit Sigoure via Stack)
HBASE-2443 IPC client can throw NPE if socket creation fails
(Todd Lipcon via Stack)
HBASE-2447 LogSyncer.addToSyncQueue doesn't check if syncer is still
running before waiting (Todd Lipcon via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -1866,9 +1866,15 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
}
results.clear();
boolean returnResult = nextInternal(limit);
if (!returnResult && filter != null && filter.filterRow()) {
if (!returnResult && filter != null) {
// final chance to modify row contents
returnResult = filter.filterRow(results);
// final chance to drop the row... This may be superfluous with the addition of the above?
// still needed for backwards compatibility however
if (returnResult || filter.filterRow()) {
results.clear();
}
}
outResults.addAll(results);
resetFilters();
if (isFilterDone()) {

View File

@ -742,6 +742,8 @@ public class HLog implements HConstants, Syncable {
private final long optionalFlushInterval;
private boolean syncerShuttingDown = false;
LogSyncer(long optionalFlushInterval) {
this.optionalFlushInterval = optionalFlushInterval;
}
@ -778,6 +780,7 @@ public class HLog implements HConstants, Syncable {
} catch (InterruptedException e) {
LOG.debug(getName() + "interrupted while waiting for sync requests");
} finally {
syncerShuttingDown = true;
syncDone.signalAll();
lock.unlock();
LOG.info(getName() + " exiting");
@ -796,6 +799,10 @@ public class HLog implements HConstants, Syncable {
}
lock.lock();
try {
if (syncerShuttingDown) {
LOG.warn(getName() + " was shut down while waiting for sync");
return;
}
if(force) {
forceSync = true;
}