diff --git a/CHANGES.txt b/CHANGES.txt index d868df09652..4453d4b6a8a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 9f5a315e69a..4c67d839b6c 100644 --- a/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -1866,8 +1866,14 @@ public class HRegion implements HConstants, HeapSize { // , Writable{ } results.clear(); boolean returnResult = nextInternal(limit); - if (!returnResult && filter != null && filter.filterRow()) { - results.clear(); + 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(); diff --git a/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java b/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java index 19c9b5437fb..d1c844d6e67 100644 --- a/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java +++ b/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java @@ -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; }