-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
- Problem:
- OnStartingFollowing(): When you add Node to leader, you receive a response from leader that returns "Not leader" (our own implementation).
- Reason
- In the internal process of jraft, node becomes leader - > sends leader heartbeat to all nodes - > other nodes become follower (asynchronous callback onStarting Following) - > leader receives all follower ACK (asynchronous callback onLeaderStart).
- So visit leader in onStarting Following, and leader will report "Not leader" because it has not yet executed onLeaderStart (because our code sets leaderTerm in onLeaderStart).
- Restoration plan
- Do not judge leader based on leaderTerm, but directly on Node.isLeader().
- Interim plan
- In the short term, you can sleep in on StartingFollowing() for a few seconds (for example, 3s) and then visit the leader.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working