You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2018/11/12 07:40:32 UTC
lucene-solr:branch_7x: SOLR-12977: Autoscaling tries to fetch metrics
from dead nodes
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 2fc689fbf -> 1adb0317f
SOLR-12977: Autoscaling tries to fetch metrics from dead nodes
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1adb0317
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1adb0317
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1adb0317
Branch: refs/heads/branch_7x
Commit: 1adb0317f010b492c083f7fb5a4c0b99cda5fcfa
Parents: 2fc689f
Author: Noble Paul <no...@apache.org>
Authored: Mon Nov 12 18:39:05 2018 +1100
Committer: Noble Paul <no...@apache.org>
Committed: Mon Nov 12 18:40:11 2018 +1100
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
.../solr/client/solrj/impl/SolrClientNodeStateProvider.java | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1adb0317/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 427220d..8bf10e9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -128,6 +128,8 @@ New Features
to set this to false (using docValues as needed) to reduce the risk of large fluxuations in heap
size due to unexpected attempts to sort/facet/function on non-docValue fields. (hossman)
+* SOLR-12977: Autoscaling tries to fetch metrics from dead nodes (noble)
+
Other Changes
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1adb0317/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
index 5a9d5b0..fc3564f 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
@@ -118,7 +118,6 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
@Override
public void writeMap(EntryWriter ew) throws IOException {
-// ew.put("liveNodes", liveNodes);
ew.put("replicaInfo", Utils.getDeepCopy(nodeVsCollectionVsShardVsReplicaInfo, 5));
ew.put("nodeValues", nodeVsTags);
}
@@ -189,6 +188,7 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
}
static void fetchReplicaMetrics(String solrNode, ClientSnitchCtx ctx, Map<String, Object> metricsKeyVsTag) {
+ if (!ctx.isNodeAlive(solrNode)) return;
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("key", metricsKeyVsTag.keySet().toArray(new String[0]));
try {
@@ -216,6 +216,7 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
static class AutoScalingSnitch extends ImplicitSnitch {
@Override
protected void getRemoteInfo(String solrNode, Set<String> requestedTags, SnitchContext ctx) {
+ if (!((ClientSnitchCtx)ctx).isNodeAlive(solrNode)) return;
ClientSnitchCtx snitchContext = (ClientSnitchCtx) ctx;
Map<String, Object> metricsKeyVsTag = new HashMap<>();
for (String tag : requestedTags) {
@@ -314,6 +315,11 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
ZkClientClusterStateProvider zkClientClusterStateProvider;
CloudSolrClient solrClient;
+ public boolean isNodeAlive(String node) {
+ if (zkClientClusterStateProvider != null && zkClientClusterStateProvider.getLiveNodes().contains(node))
+ return true;
+ return true;
+ }
public ClientSnitchCtx(SnitchInfo perSnitch,
String node, Map<String, Object> session,
CloudSolrClient solrClient) {