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) (Benoit Sigoure via Stack)
HBASE-2443 IPC client can throw NPE if socket creation fails HBASE-2443 IPC client can throw NPE if socket creation fails
(Todd Lipcon via Stack) (Todd Lipcon via Stack)
HBASE-2447 LogSyncer.addToSyncQueue doesn't check if syncer is still
running before waiting (Todd Lipcon via Stack)
IMPROVEMENTS IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable HBASE-1760 Cleanup TODOs in HTable

View File

@ -1866,8 +1866,14 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
} }
results.clear(); results.clear();
boolean returnResult = nextInternal(limit); boolean returnResult = nextInternal(limit);
if (!returnResult && filter != null && filter.filterRow()) { if (!returnResult && filter != null) {
results.clear(); // 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); outResults.addAll(results);
resetFilters(); resetFilters();

View File

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