Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-14371 Zk StatusHandler should know about dynamic zk config #1392

Merged
merged 18 commits into from
Apr 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More review fixes
  • Loading branch information
janhoy committed Apr 1, 2020
commit e765ac26e04994bc73a74a46222aaeac41fecf19
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw
*/
protected Map<String, Object> getZkStatus(String zkHost, List<SolrZkClient.ZkConfigDyn> zkDynamicConfig) {
final List<SolrZkClient.ZkConfigDyn> zookeepers;
boolean dynamicReconfig = false;
if (CollectionUtils.isEmpty(zkDynamicConfig)) {
// Fallback to parsing zkHost for older zk servers without support for dynamic reconfiguration
zookeepers = Arrays.stream(zkHost.split("/")[0].split(","))
Expand All @@ -106,6 +107,7 @@ protected Map<String, Object> getZkStatus(String zkHost, List<SolrZkClient.ZkCon
h.contains(":") ? Integer.parseInt(h.split(":")[1]) : 2181)
).collect(Collectors.toList());
} else {
dynamicReconfig = true;
zookeepers = new ArrayList<>(zkDynamicConfig); // Clone input
}
final Map<String, Object> zkStatus = new HashMap<>();
Expand All @@ -116,7 +118,6 @@ protected Map<String, Object> getZkStatus(String zkHost, List<SolrZkClient.ZkCon
int followers = 0;
int reportedFollowers = 0;
int leaders = 0;
boolean dynamicReconfig = false;
final List<String> errors = new ArrayList<>();
zkStatus.put("ensembleSize", zookeepers.size());
zkStatus.put("zkHost", zkHost);
Expand All @@ -143,7 +144,6 @@ protected Map<String, Object> getZkStatus(String zkHost, List<SolrZkClient.ZkCon
}
if (zk.role != null) {
stat.put("role", zk.role);
dynamicReconfig = true;
}
} catch (SolrException se) {
log.warn("Failed talking to zookeeper " + zkClientHostPort, se);
Expand Down