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

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

Commit 98a61bf53f16c0ea27225e31415f56d027076179 in solr's branch 
refs/heads/main from NextBrickINC.com
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=98a61bf53f1 ]

SOLR-18298: only recover after ZooKeeper session expiry (#4774)

The migration to curator incidentally resulted in Solr's onReconnect triggering 
on reconnect. Funnily enough, that's not the desired behavior at this point. 
Solr's OnReconnect was designed to be triggered only when there is a reconnect 
*after* zk session expiration (so it is not literally "on reconnect"). This fix 
is the minimal way of reverting to the old behavior while keeping the naming.

Co-authored-by: Shrey Narayan <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: rayshrey <[email protected]>

> ZkController.onReconnect Is Triggered Excessively
> -------------------------------------------------
>
>                 Key: SOLR-18298
>                 URL: https://issues.apache.org/jira/browse/SOLR-18298
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>    Affects Versions: 10.0
>            Reporter: Jerry
>            Priority: Blocker
>              Labels: patch, pull-request-available, zookeeper
>         Attachments: 
> SOLR-18298_PR-4774_AtomicBoolean_Technical_Brief_Secure_Shrey_Narayan_Public_Citations.pdf,
>  SOLR-18298_PR-4774_Technical_Review_NextBricks_Shrey Narayan.pdf
>
>          Time Spent: 9h 10m
>  Remaining Estimate: 0h
>
> Curator's RECONNECTED event is different from the previous RECONNECTED event. 
> Before Solr10, the OnReconnect is only triggered after a session expiration 
> and reconnection.
> Check the following
> [https://github.com/apache/solr/blob/fdb5314279657f7895a90123436d834e81ea3157/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ConnectionManager.java#L165]
>  
> [https://github.com/apache/solr/blob/fdb5314279657f7895a90123436d834e81ea3157/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ConnectionManager.java#L199]
> But Curator's RECONNECTED event is triggered every time a Solr node is 
> disconnected from a ZooKeeper instance and reconnected to another
>  ZooKeeper instance
> Therefore, currently ZkController.onReconnect is invoked  every time a Solr 
> node is disconnected from a ZooKeeper instance and reconnected, which is a 
> huge overhead, especially when we need to rolling restart a ZooKeeper 
> Cluster. It can take more than 10 minutes for a small Solr cluster to level 
> out.
> Similiarly, now ZkController.onDisconnect is triggered just after a 
> disconnection from a Zookeeper instance. It should only be triggered after a 
> session expiration.
> The PR restores the Solr 9 behavior, triggering re-election and other 
> initialization staff only when the session actually expires, which 
> significantly reduces performance overhead during network hiccups or 
> situations like rolling-restart Zookeeper Cluster.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to