HBASE-21575 : memstore above high watermark message is logged too much

This commit is contained in:
Sergey Shelukhin 2018-12-12 11:02:25 -08:00
parent 3015e23c09
commit 7cefd8bc25

View File

@ -585,6 +585,7 @@ class MemStoreFlusher implements FlushRequester {
scope.getSpan().addTimelineAnnotation("Force Flush. We're above high water mark."); scope.getSpan().addTimelineAnnotation("Force Flush. We're above high water mark.");
} }
long start = EnvironmentEdgeManager.currentTime(); long start = EnvironmentEdgeManager.currentTime();
long nextLogTimeMs = start;
synchronized (this.blockSignal) { synchronized (this.blockSignal) {
boolean blocked = false; boolean blocked = false;
long startTime = 0; long startTime = 0;
@ -610,8 +611,11 @@ class MemStoreFlusher implements FlushRequester {
LOG.warn("Interrupted while waiting"); LOG.warn("Interrupted while waiting");
interrupted = true; interrupted = true;
} }
long took = EnvironmentEdgeManager.currentTime() - start; long nowMs = EnvironmentEdgeManager.currentTime();
LOG.warn("Memstore is above high water mark and block " + took + "ms"); if (nowMs >= nextLogTimeMs) {
LOG.warn("Memstore is above high water mark and block " + (nowMs - start) + " ms");
nextLogTimeMs = nowMs + 1000;
}
} }
} finally { } finally {
if (interrupted) { if (interrupted) {