diff options
author | Jon Bratseth <bratseth@oath.com> | 2019-10-04 23:21:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-04 23:21:16 +0200 |
commit | 969ef6519225f5a875e70628d0b5c4ba1a9477cf (patch) | |
tree | f037a68cc421c04a77a39fba9d47edddb3a17961 | |
parent | 0ba8a06e0eb7b8f48b6cadddb4b06770f82caaec (diff) | |
parent | 3aa70bf72b08567521b92944aa05ed58271f3570 (diff) |
Merge pull request #10888 from vespa-engine/balder/do-not-log-too-often
Avoid too much logging during node up and down.
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java b/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java index 831033760e6..3595a24ca92 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java @@ -46,6 +46,7 @@ public class SearchCluster implements NodeManager<Node> { private final ClusterMonitor<Node> clusterMonitor; private final VipStatus vipStatus; private PingFactory pingFactory; + private long nextLogTime = 0; /** * A search node on this local machine having the entire corpus, which we therefore @@ -413,7 +414,8 @@ public class SearchCluster implements NodeManager<Node> { private void trackGroupCoverageChanges(int index, Group group, boolean fullCoverage, long averageDocuments) { boolean changed = group.isFullCoverageStatusChanged(fullCoverage); - if (changed || !fullCoverage) { + if (changed || (!fullCoverage && System.currentTimeMillis() > nextLogTime)) { + nextLogTime = System.currentTimeMillis() + 30 * 1000; int requiredNodes = groupSize() - dispatchConfig.maxNodesDownPerGroup(); if (fullCoverage) { log.info(() -> String.format("Group %d is now good again (%d/%d active docs, coverage %d/%d)", |