You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Matthew Biscocho (Jira)" <ji...@apache.org> on 2025/05/06 20:29:00 UTC
[jira] [Resolved] (SOLR-17745) Reduce leader election optimization never occurs
[ https://issues.apache.org/jira/browse/SOLR-17745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthew Biscocho resolved SOLR-17745.
-------------------------------------
Resolution: Fixed
> Reduce leader election optimization never occurs
> ------------------------------------------------
>
> Key: SOLR-17745
> URL: https://issues.apache.org/jira/browse/SOLR-17745
> Project: Solr
> Issue Type: Bug
> Affects Versions: 8.11.4, 9.8.1
> Reporter: Luke Kot-Zaniewski
> Assignee: Matthew Biscocho
> Priority: Major
> Labels: pull-request-available
> Fix For: main (10.0), 9.9
>
> Time Spent: 2h
> Remaining Estimate: 0h
>
> It appears the optimization in SOLR-14942 never actually happens. The reason is the seemingly innocuous check of [zkController.isClosed|https://github.com/apache/solr/blob/57de0e8dece2f333a624b6498d139af31d00038c/solr/core/src/java/org/apache/solr/cloud/ZkController.java#L2154] which actually ends up always skipping the leader election node cleanup. This is *not* because the ZK session is actually closed but rather a side-effect of the complex implementation of [SolrZkClient::isClosed|https://github.com/apache/solr/blob/d1498e8d5a7f4382a83a2800a0d1568bcd0f2a55/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java#L852-L854] which also checks its "higher level" for closure. The higherLevelIsClosed delegates to [CoreContainer::isShutDown|https://github.com/apache/solr/blob/6d84e8f97611685df7b39278737ca7bc9fc326d8/solr/core/src/java/org/apache/solr/cloud/ZkController.java#L355] which actually gets set to true in an [earlier point in the shutdown sequence|https://github.com/apache/solr/blob/6d84e8f97611685df7b39278737ca7bc9fc326d8/solr/core/src/java/org/apache/solr/core/CoreContainer.java#L1299-L1308]. Thus this optimization never materializes.
> A seemingly easy fix for this would be to check SolrZkClient::isConnected instead of isClosed. Will follow up with a PR.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org