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

Gregory Chanan commented on SOLR-8069:
--------------------------------------

Most of this seems like just adding defensive checks, which seem reasonable.

{code}List<Op> ops = new ArrayList<>(2);{code}
nit: this should be 3 in two places.

{code}
+      ops.add(Op.check(new 
org.apache.hadoop.fs.Path(((ShardLeaderElectionContextBase)context).leaderPath).getParent().toString(),
 leaderZkNodeParentVersion));
       ops.add(Op.setData(znodePath, znodeData, -1));
{code}
What happens if the leaderZkNodeParentVersion doesn't match?  Presumably that's 
a possibility or else why add the check.  We don't want to loop and see if we 
get an updated version in electionContexts?  I'm certainly not well versed in 
this area of the code but checking isLeader seems a little roundabount -- isn't 
the leaderZkNodeParentVersion what we actually care about?  What happens if we 
think we are the leader but the version doesn't match?  What does that mean?  
Certainly we can optimistically try whatever we pulled out of electionContexts 
the first time, as you've done here to avoid a zk trip.

> Ensure that only the valid ZooKeeper registered leader can put a replica into 
> Leader Initiated Recovery.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8069
>                 URL: https://issues.apache.org/jira/browse/SOLR-8069
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>            Priority: Critical
>         Attachments: SOLR-8069.patch, SOLR-8069.patch
>
>
> I've seen this twice now. Need to work on a test.
> When some issues hit all the replicas at once, you can end up in a situation 
> where the rightful leader was put or put itself into LIR. Even on restart, 
> this rightful leader won't take leadership and you have to manually clear the 
> LIR nodes.
> It seems that if all the replicas participate in election on startup, LIR 
> should just be cleared.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to