superchee0526 opened a new pull request, #353:
URL: https://github.com/apache/kvrocks-controller/pull/353

   When deploying multiple controllers, the old leader lost the leader doesn't 
update the preTermLeader information. This will cause later leader resume 
cannot be accessed.
   
                        if c.clusterStore.IsLeader() {
                                if prevTermLeader != c.clusterStore.ID() {
                                        c.becomeLeader(ctx, prevTermLeader)
                                        prevTermLeader = c.clusterStore.ID()
                                }
                        } else {
                                if prevTermLeader != c.clusterStore.ID() {
                                        continue
                                }
                                c.suspend()
                                prevTermLeader = c.clusterStore.Leader()
                                logger.Get().Warn("Lost the leader, suspend the 
controller")
                        }
   
   1. A is leader, B is follower
   2. leader change to B: A lost the leader and suspend(), however the 
prevTermLeader is still A
   3. When A re-get the leadership, since prevTermLeader == 
c.clusterStore.ID(), it cannot resume the leadership


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to