[ 
https://issues.apache.org/jira/browse/SOLR-17745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949831#comment-17949831
 ] 

ASF subversion and git services commented on SOLR-17745:
--------------------------------------------------------

Commit 1a8131c45868ee606348f2502fe57233e3d4489c in solr's branch 
refs/heads/main from Matthew Biscocho
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=1a8131c4586 ]

SOLR-17745: Reduce leader election optimization never occurs (#3330)

Cancel leader election was being skipped on core container shutdown due to 
incorrect zkClient check

---------

Co-authored-by: Luke Kot-Zaniewski <l.kotzaniew...@gmail.com>

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

Reply via email to