From 7cefd8bc251ec55e9c9628ad7ebccfd641a0d053 Mon Sep 17 00:00:00 2001 From: Sergey Shelukhin Date: Wed, 12 Dec 2018 11:02:25 -0800 Subject: [PATCH] HBASE-21575 : memstore above high watermark message is logged too much --- .../apache/hadoop/hbase/regionserver/MemStoreFlusher.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java index 9545014e817..debca0f4aae 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java @@ -585,6 +585,7 @@ class MemStoreFlusher implements FlushRequester { scope.getSpan().addTimelineAnnotation("Force Flush. We're above high water mark."); } long start = EnvironmentEdgeManager.currentTime(); + long nextLogTimeMs = start; synchronized (this.blockSignal) { boolean blocked = false; long startTime = 0; @@ -610,8 +611,11 @@ class MemStoreFlusher implements FlushRequester { LOG.warn("Interrupted while waiting"); interrupted = true; } - long took = EnvironmentEdgeManager.currentTime() - start; - LOG.warn("Memstore is above high water mark and block " + took + "ms"); + long nowMs = EnvironmentEdgeManager.currentTime(); + if (nowMs >= nextLogTimeMs) { + LOG.warn("Memstore is above high water mark and block " + (nowMs - start) + " ms"); + nextLogTimeMs = nowMs + 1000; + } } } finally { if (interrupted) {