diff options
author | jonmv <venstad@gmail.com> | 2023-09-01 10:53:46 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2023-09-01 10:53:46 +0200 |
commit | 1dbda815fe14531068c001f27a95798d3f7788cf (patch) | |
tree | 3b805129c45213c7d4e0b4491711ed6ab3eec2b7 /container-search/src/main | |
parent | 99b0f7d05af58420f28a89b177ebc9613f112ebc (diff) |
Update whether local corpus on localhost with new config
Diffstat (limited to 'container-search/src/main')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java | 3 |
1 files changed, 2 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 3c8950f1f7f..ce602ffcdaa 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 @@ -42,7 +42,7 @@ public class SearchCluster implements NodeManager<Node> { * if it only queries this cluster when the local node cannot be used, to avoid unnecessary * cross-node network traffic. */ - private final Node localCorpusDispatchTarget; + private volatile Node localCorpusDispatchTarget; public SearchCluster(String clusterId, double minActivedocsPercentage, Collection<Node> nodes, VipStatus vipStatus, PingFactory pingFactory) { @@ -75,6 +75,7 @@ public class SearchCluster implements NodeManager<Node> { try { while (addedNodes.stream().anyMatch(node -> node.isWorking() == null)) { Thread.sleep(1); } } catch (InterruptedException e) { throw new UncheckedInterruptedException(e, true); } pingIterationCompleted(groups); + this.localCorpusDispatchTarget = findLocalCorpusDispatchTarget(HostName.getLocalhost(), groups); this.groups = groups; return monitor; } |