noblepaul commented on a change in pull request #2148:
URL: https://github.com/apache/lucene-solr/pull/2148#discussion_r547042695



##########
File path: 
solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContextBase.java
##########
@@ -179,7 +183,16 @@ void runLeaderProcess(boolean weAreReplacement, int 
pauseBeforeStartMs)
           ZkStateReader.STATE_PROP, Replica.State.ACTIVE.toString());
       assert zkController != null;
       assert zkController.getOverseer() != null;
-      zkController.getOverseer().offerStateUpdate(Utils.toJSON(m));
+      DocCollection coll = zkStateReader.getCollection(this.collection);
+      if (coll == null || coll.getStateFormat() < 2 || 
ZkController.sendToOverseer(coll, id)) {
+        zkController.getOverseer().offerStateUpdate(Utils.toJSON(m));
+      } else {
+        PerReplicaStates prs = PerReplicaStates.fetch(coll.getZNode(), 
zkClient, coll.getPerReplicaStates());
+        PerReplicaStates.WriteOps writeOps = 
PerReplicaStates.WriteOps.flipLeader(zkStateReader.getClusterState().getCollection(collection).getSlice(shardId).getReplicaNames(),
 id, prs);
+        //nocommit make this debug
+        log.info("bypassed Zookeeper for leader election for {}/{}, old:{},new 
{} ", this.collection, shardId, currentLeader, id);

Review comment:
       Yes, it's true. bypassed overseer, but not zookeeper
   
   it's a nocommit added for debugging. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to