From 2c56399b015c727079b355a5c3a53dbcc4a7e271 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Mon, 24 Nov 2008 22:58:36 +0000 Subject: [PATCH] HBASE-1023 Check global flusher git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@720325 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../hadoop/hbase/regionserver/MemcacheFlusher.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 63a4e5dc03d..bb4096b0c86 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -82,6 +82,7 @@ Release 0.19.0 - Unreleased HBASE-1009 Master stuck in loop wanting to assign but regions are closing HBASE-1016 Fix example in javadoc overvie HBASE-1021 hbase metrics FileContext not working + HBASE-1023 Check global flusher IMPROVEMENTS HBASE-901 Add a limit to key length, check key and value length on client side diff --git a/src/java/org/apache/hadoop/hbase/regionserver/MemcacheFlusher.java b/src/java/org/apache/hadoop/hbase/regionserver/MemcacheFlusher.java index 0f70445f7f1..564171b2248 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/MemcacheFlusher.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/MemcacheFlusher.java @@ -220,17 +220,23 @@ class MemcacheFlusher extends Thread implements FlushRequester { */ private synchronized void flushSomeRegions() { // keep flushing until we hit the low water mark + long globalMemcacheSize = -1; for (SortedMap m = this.server.getCopyOfOnlineRegionsSortedBySize(); - server.getGlobalMemcacheSize() >= globalMemcacheLimitLowMark;) { + (globalMemcacheSize = server.getGlobalMemcacheSize()) >= + this.globalMemcacheLimitLowMark;) { // flush the region with the biggest memcache if (m.size() <= 0) { LOG.info("No online regions to flush though we've been asked flush " + - "some; globalMemcacheSize=" + this.server.getGlobalMemcacheSize() + + "some; globalMemcacheSize=" + globalMemcacheSize + ", globalMemcacheLimitLowMark=" + this.globalMemcacheLimitLowMark); break; } HRegion biggestMemcacheRegion = m.remove(m.firstKey()); + LOG.info("Forced flushing of " + biggestMemcacheRegion.toString() + + " because global memcache limit of " + this.globalMemcacheLimit + + " exceeded; currenly " + globalMemcacheSize + " and flushing till " + + this.globalMemcacheLimitLowMark); if (!flushRegion(biggestMemcacheRegion, true)) { // Something bad happened - give up. break;