Luke Kot-Zaniewski created SOLR-17745:
-----------------------------------------

             Summary: 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: 9.8.1, 8.11.4
            Reporter: Luke Kot-Zaniewski


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-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to