# Test which demonstrates how a leader steps down when a peer is stranded at a
# higher term, after a series of hung elections, using pre-vote.

add-nodes 3 voters=(1,2,3) index=10 prevote=true checkquorum=true
----
INFO 1 switched to configuration voters=(1 2 3)
INFO 1 became follower at term 0
DEBUG 1 reset election elapsed to 0
INFO newRaft 1 [peers: [1,2,3], term: 0, commit: 10, applied: 10, lastindex: 10, lastterm: 1]
INFO 2 switched to configuration voters=(1 2 3)
INFO 2 became follower at term 0
DEBUG 2 reset election elapsed to 0
INFO newRaft 2 [peers: [1,2,3], term: 0, commit: 10, applied: 10, lastindex: 10, lastterm: 1]
INFO 3 switched to configuration voters=(1 2 3)
INFO 3 became follower at term 0
DEBUG 3 reset election elapsed to 0
INFO newRaft 3 [peers: [1,2,3], term: 0, commit: 10, applied: 10, lastindex: 10, lastterm: 1]

###############################################################################
# Strand node 3 at a higher term. This is a little more complicated with
# prevote, but it is possible.
###############################################################################

campaign 3
----
INFO 3 is starting a new election at term 0
INFO 3 became pre-candidate at term 0
INFO 3 [logterm: 1, index: 10] sent MsgPreVote request to 1 at term 0
INFO 3 [logterm: 1, index: 10] sent MsgPreVote request to 2 at term 0

stabilize 3
----
> 3 handling Ready
  Ready MustSync=false:
  State:StatePreCandidate
  Messages:
  3->1 MsgPreVote Term:1 Log:1/10
  3->2 MsgPreVote Term:1 Log:1/10
  INFO 3 received MsgPreVoteResp from 3 at term 0
  INFO 3 has received 1 MsgPreVoteResp votes and 0 vote rejections

stabilize 2
----
> 2 receiving messages
  3->2 MsgPreVote Term:1 Log:1/10
  INFO 2 [logterm: 1, index: 10, vote: 0] cast MsgPreVote for 3 [logterm: 1, index: 10] at term 0
> 2 handling Ready
  Ready MustSync=false:
  Messages:
  2->3 MsgPreVoteResp Term:1 Log:0/0

stabilize 3
----
> 3 receiving messages
  2->3 MsgPreVoteResp Term:1 Log:0/0
  INFO 3 received MsgPreVoteResp from 2 at term 0
  INFO 3 has received 2 MsgPreVoteResp votes and 0 vote rejections
  INFO 3 became candidate at term 1
  INFO 3 [logterm: 1, index: 10] sent MsgVote request to 1 at term 1
  INFO 3 [logterm: 1, index: 10] sent MsgVote request to 2 at term 1
> 3 handling Ready
  Ready MustSync=true:
  State:StateCandidate
  HardState Term:1 Vote:3 Commit:10 Lead:0 LeadEpoch:0
  Messages:
  3->1 MsgVote Term:1 Log:1/10
  3->2 MsgVote Term:1 Log:1/10
  INFO 3 received MsgVoteResp from 3 at term 1
  INFO 3 has received 1 MsgVoteResp votes and 0 vote rejections

deliver-msgs drop=(2)
----
dropped: 3->2 MsgVote Term:1 Log:1/10

# Set the randomized election timeout to be worth 1 tick-election. This makes the
# test deterministic.
set-randomized-election-timeout 3 timeout=3
----
ok

tick-election 3
----
INFO 3 is starting a new election at term 1
INFO 3 became pre-candidate at term 1
INFO 3 [logterm: 1, index: 10] sent MsgPreVote request to 1 at term 1
INFO 3 [logterm: 1, index: 10] sent MsgPreVote request to 2 at term 1

stabilize 3
----
> 3 handling Ready
  Ready MustSync=false:
  State:StatePreCandidate
  Messages:
  3->1 MsgPreVote Term:2 Log:1/10
  3->2 MsgPreVote Term:2 Log:1/10
  INFO 3 received MsgPreVoteResp from 3 at term 1
  INFO 3 has received 1 MsgPreVoteResp votes and 0 vote rejections

stabilize 2
----
> 2 receiving messages
  3->2 MsgPreVote Term:2 Log:1/10
  INFO 2 [logterm: 1, index: 10, vote: 0] cast MsgPreVote for 3 [logterm: 1, index: 10] at term 0
> 2 handling Ready
  Ready MustSync=false:
  Messages:
  2->3 MsgPreVoteResp Term:2 Log:0/0

stabilize 3
----
> 3 receiving messages
  2->3 MsgPreVoteResp Term:2 Log:0/0
  INFO 3 received MsgPreVoteResp from 2 at term 1
  INFO 3 has received 2 MsgPreVoteResp votes and 0 vote rejections
  INFO 3 became candidate at term 2
  INFO 3 [logterm: 1, index: 10] sent MsgVote request to 1 at term 2
  INFO 3 [logterm: 1, index: 10] sent MsgVote request to 2 at term 2
> 3 handling Ready
  Ready MustSync=true:
  State:StateCandidate
  HardState Term:2 Vote:3 Commit:10 Lead:0 LeadEpoch:0
  Messages:
  3->1 MsgVote Term:2 Log:1/10
  3->2 MsgVote Term:2 Log:1/10
  INFO 3 received MsgVoteResp from 3 at term 2
  INFO 3 has received 1 MsgVoteResp votes and 0 vote rejections

deliver-msgs drop=(2)
----
dropped: 3->2 MsgVote Term:2 Log:1/10

set-randomized-election-timeout 3 timeout=3
----
ok

tick-election 3
----
INFO 3 is starting a new election at term 2
INFO 3 became pre-candidate at term 2
INFO 3 [logterm: 1, index: 10] sent MsgPreVote request to 1 at term 2
INFO 3 [logterm: 1, index: 10] sent MsgPreVote request to 2 at term 2

stabilize 3
----
> 3 handling Ready
  Ready MustSync=false:
  State:StatePreCandidate
  Messages:
  3->1 MsgPreVote Term:3 Log:1/10
  3->2 MsgPreVote Term:3 Log:1/10
  INFO 3 received MsgPreVoteResp from 3 at term 2
  INFO 3 has received 1 MsgPreVoteResp votes and 0 vote rejections

stabilize 2
----
> 2 receiving messages
  3->2 MsgPreVote Term:3 Log:1/10
  INFO 2 [logterm: 1, index: 10, vote: 0] cast MsgPreVote for 3 [logterm: 1, index: 10] at term 0
> 2 handling Ready
  Ready MustSync=false:
  Messages:
  2->3 MsgPreVoteResp Term:3 Log:0/0

stabilize 3
----
> 3 receiving messages
  2->3 MsgPreVoteResp Term:3 Log:0/0
  INFO 3 received MsgPreVoteResp from 2 at term 2
  INFO 3 has received 2 MsgPreVoteResp votes and 0 vote rejections
  INFO 3 became candidate at term 3
  INFO 3 [logterm: 1, index: 10] sent MsgVote request to 1 at term 3
  INFO 3 [logterm: 1, index: 10] sent MsgVote request to 2 at term 3
> 3 handling Ready
  Ready MustSync=true:
  State:StateCandidate
  HardState Term:3 Vote:3 Commit:10 Lead:0 LeadEpoch:0
  Messages:
  3->1 MsgVote Term:3 Log:1/10
  3->2 MsgVote Term:3 Log:1/10
  INFO 3 received MsgVoteResp from 3 at term 3
  INFO 3 has received 1 MsgVoteResp votes and 0 vote rejections

deliver-msgs drop=(1, 2)
----
dropped: 3->1 MsgPreVote Term:1 Log:1/10
dropped: 3->1 MsgVote Term:1 Log:1/10
dropped: 3->1 MsgPreVote Term:2 Log:1/10
dropped: 3->1 MsgVote Term:2 Log:1/10
dropped: 3->1 MsgPreVote Term:3 Log:1/10
dropped: 3->1 MsgVote Term:3 Log:1/10
dropped: 3->2 MsgVote Term:3 Log:1/10

raft-state
----
1: StateFollower (Voter) Term:0 Lead:0 LeadEpoch:0
2: StateFollower (Voter) Term:0 Lead:0 LeadEpoch:0
3: StateCandidate (Voter) Term:3 Lead:0 LeadEpoch:0

###############################################################################
# Now that node 3 is stranded, establish node 1 as leader of term 1.
###############################################################################

campaign 1
----
INFO 1 is starting a new election at term 0
INFO 1 became pre-candidate at term 0
INFO 1 [logterm: 1, index: 10] sent MsgPreVote request to 2 at term 0
INFO 1 [logterm: 1, index: 10] sent MsgPreVote request to 3 at term 0

stabilize 1 2
----
> 1 handling Ready
  Ready MustSync=false:
  State:StatePreCandidate
  Messages:
  1->2 MsgPreVote Term:1 Log:1/10
  1->3 MsgPreVote Term:1 Log:1/10
  INFO 1 received MsgPreVoteResp from 1 at term 0
  INFO 1 has received 1 MsgPreVoteResp votes and 0 vote rejections
> 2 receiving messages
  1->2 MsgPreVote Term:1 Log:1/10
  INFO 2 [logterm: 1, index: 10, vote: 0] cast MsgPreVote for 1 [logterm: 1, index: 10] at term 0
> 2 handling Ready
  Ready MustSync=false:
  Messages:
  2->1 MsgPreVoteResp Term:1 Log:0/0
> 1 receiving messages
  2->1 MsgPreVoteResp Term:1 Log:0/0
  INFO 1 received MsgPreVoteResp from 2 at term 0
  INFO 1 has received 2 MsgPreVoteResp votes and 0 vote rejections
  INFO 1 became candidate at term 1
  INFO 1 [logterm: 1, index: 10] sent MsgVote request to 2 at term 1
  INFO 1 [logterm: 1, index: 10] sent MsgVote request to 3 at term 1
> 1 handling Ready
  Ready MustSync=true:
  State:StateCandidate
  HardState Term:1 Vote:1 Commit:10 Lead:0 LeadEpoch:0
  Messages:
  1->2 MsgVote Term:1 Log:1/10
  1->3 MsgVote Term:1 Log:1/10
  INFO 1 received MsgVoteResp from 1 at term 1
  INFO 1 has received 1 MsgVoteResp votes and 0 vote rejections
> 2 receiving messages
  1->2 MsgVote Term:1 Log:1/10
  INFO 2 [term: 0] received a MsgVote message with higher term from 1 [term: 1], advancing term
  INFO 2 became follower at term 1
  DEBUG 2 reset election elapsed to 0
  INFO 2 [logterm: 1, index: 10, vote: 0] cast MsgVote for 1 [logterm: 1, index: 10] at term 1
> 2 handling Ready
  Ready MustSync=true:
  HardState Term:1 Vote:1 Commit:10 Lead:0 LeadEpoch:0
  Messages:
  2->1 MsgVoteResp Term:1 Log:0/0
> 1 receiving messages
  2->1 MsgVoteResp Term:1 Log:0/0
  INFO 1 received MsgVoteResp from 2 at term 1
  INFO 1 has received 2 MsgVoteResp votes and 0 vote rejections
  INFO 1 became leader at term 1
> 1 handling Ready
  Ready MustSync=true:
  State:StateLeader
  HardState Term:1 Vote:1 Commit:10 Lead:1 LeadEpoch:1
  Entries:
  1/11 EntryNormal ""
  Messages:
  1->2 MsgFortifyLeader Term:1 Log:0/0
  1->3 MsgFortifyLeader Term:1 Log:0/0
  1->2 MsgApp Term:1 Log:1/10 Commit:10 Entries:[1/11 EntryNormal ""]
  1->3 MsgApp Term:1 Log:1/10 Commit:10 Entries:[1/11 EntryNormal ""]
> 2 receiving messages
  1->2 MsgFortifyLeader Term:1 Log:0/0
  1->2 MsgApp Term:1 Log:1/10 Commit:10 Entries:[1/11 EntryNormal ""]
> 2 handling Ready
  Ready MustSync=true:
  HardState Term:1 Vote:1 Commit:10 Lead:1 LeadEpoch:1
  Entries:
  1/11 EntryNormal ""
  Messages:
  2->1 MsgFortifyLeaderResp Term:1 Log:0/0 LeadEpoch:1
  2->1 MsgAppResp Term:1 Log:0/11 Commit:10
> 1 receiving messages
  2->1 MsgFortifyLeaderResp Term:1 Log:0/0 LeadEpoch:1
  2->1 MsgAppResp Term:1 Log:0/11 Commit:10
> 1 handling Ready
  Ready MustSync=true:
  HardState Term:1 Vote:1 Commit:11 Lead:1 LeadEpoch:1
  CommittedEntries:
  1/11 EntryNormal ""
  Messages:
  1->2 MsgApp Term:1 Log:1/10 Commit:10 Entries:[1/11 EntryNormal ""]
  1->2 MsgApp Term:1 Log:1/11 Commit:11
> 2 receiving messages
  1->2 MsgApp Term:1 Log:1/10 Commit:10 Entries:[1/11 EntryNormal ""]
  1->2 MsgApp Term:1 Log:1/11 Commit:11
> 2 handling Ready
  Ready MustSync=true:
  HardState Term:1 Vote:1 Commit:11 Lead:1 LeadEpoch:1
  CommittedEntries:
  1/11 EntryNormal ""
  Messages:
  2->1 MsgAppResp Term:1 Log:0/11 Commit:10
  2->1 MsgAppResp Term:1 Log:0/11 Commit:11
> 1 receiving messages
  2->1 MsgAppResp Term:1 Log:0/11 Commit:10
  2->1 MsgAppResp Term:1 Log:0/11 Commit:11

deliver-msgs drop=(3)
----
dropped: 1->3 MsgPreVote Term:1 Log:1/10
dropped: 1->3 MsgVote Term:1 Log:1/10
dropped: 1->3 MsgFortifyLeader Term:1 Log:0/0
dropped: 1->3 MsgApp Term:1 Log:1/10 Commit:10 Entries:[1/11 EntryNormal ""]

raft-state
----
1: StateLeader (Voter) Term:1 Lead:1 LeadEpoch:1
2: StateFollower (Voter) Term:1 Lead:1 LeadEpoch:1
3: StateCandidate (Voter) Term:3 Lead:0 LeadEpoch:0

###############################################################################
# Reconnect node 1 and 3 and demonstrate that node 1 steps down as leader to
# catch up to node 3's term.
###############################################################################

tick-heartbeat 1
----
ok

stabilize 1 3
----
> 1 handling Ready
  Ready MustSync=false:
  Messages:
  1->3 MsgFortifyLeader Term:1 Log:0/0
  1->3 MsgApp Term:1 Log:1/10 Commit:11 Entries:[1/11 EntryNormal ""]
> 3 receiving messages
  1->3 MsgFortifyLeader Term:1 Log:0/0
  1->3 MsgApp Term:1 Log:1/10 Commit:11 Entries:[1/11 EntryNormal ""]
> 3 handling Ready
  Ready MustSync=false:
  Messages:
  3->1 MsgAppResp Term:3 Log:0/0
  3->1 MsgAppResp Term:3 Log:0/0
> 1 receiving messages
  3->1 MsgAppResp Term:3 Log:0/0
  INFO 1 [logterm: 1, index: 11, vote: 1] ignored MsgAppResp from 3 [logterm: 0, index: 0] at term 1: supporting fortified leader 1 at epoch 1
  INFO 1 [term: 1] received a MsgAppResp message with higher term from 3 [term: 3], intending to step down as leader to recover stranded peer
  3->1 MsgAppResp Term:3 Log:0/0
  INFO 1 [logterm: 1, index: 11, vote: 1] ignored MsgAppResp from 3 [logterm: 0, index: 0] at term 1: supporting fortified leader 1 at epoch 1
  INFO 1 [term: 1] received a MsgAppResp message with higher term from 3 [term: 3], intending to step down as leader to recover stranded peer

# Now that we are intending to step down, we should step down after the support
# expired on the next tick.
support-expired 1
----
ok

tick-heartbeat 1
----
DEBUG 1 setting election elapsed to start from 3 ticks after store liveness support expired
INFO 1 became follower at term 3
DEBUG 1 reset election elapsed to 0

support-expired 1 reset
----
ok

campaign 1
----
INFO 1 is starting a new election at term 3
INFO 1 became pre-candidate at term 3
INFO 1 [logterm: 1, index: 11] sent MsgPreVote request to 2 at term 3
INFO 1 [logterm: 1, index: 11] sent MsgPreVote request to 3 at term 3

stabilize
----
> 1 handling Ready
  Ready MustSync=true:
  State:StatePreCandidate
  HardState Term:3 Commit:11 Lead:0 LeadEpoch:0
  Messages:
  1->2 MsgDeFortifyLeader Term:1 Log:0/0
  1->3 MsgDeFortifyLeader Term:1 Log:0/0
  1->2 MsgPreVote Term:4 Log:1/11
  1->3 MsgPreVote Term:4 Log:1/11
  INFO 1 received MsgPreVoteResp from 1 at term 3
  INFO 1 has received 1 MsgPreVoteResp votes and 0 vote rejections
> 2 receiving messages
  1->2 MsgDeFortifyLeader Term:1 Log:0/0
  DEBUG 2 setting election elapsed to start from 3 ticks after store liveness support expired
  1->2 MsgPreVote Term:4 Log:1/11
  INFO 2 [logterm: 1, index: 11, vote: 1] cast MsgPreVote for 1 [logterm: 1, index: 11] at term 1
> 3 receiving messages
  1->3 MsgDeFortifyLeader Term:1 Log:0/0
  INFO 3 [term: 3] ignored a MsgDeFortifyLeader message with lower term from 1 [term: 1]
  1->3 MsgPreVote Term:4 Log:1/11
  INFO 3 [logterm: 1, index: 10, vote: 3] cast MsgPreVote for 1 [logterm: 1, index: 11] at term 3
> 2 handling Ready
  Ready MustSync=true:
  HardState Term:1 Vote:1 Commit:11 Lead:1 LeadEpoch:0
  Messages:
  2->1 MsgPreVoteResp Term:4 Log:0/0
> 3 handling Ready
  Ready MustSync=false:
  Messages:
  3->1 MsgPreVoteResp Term:4 Log:0/0
> 1 receiving messages
  2->1 MsgPreVoteResp Term:4 Log:0/0
  INFO 1 received MsgPreVoteResp from 2 at term 3
  INFO 1 has received 2 MsgPreVoteResp votes and 0 vote rejections
  INFO 1 became candidate at term 4
  INFO 1 [logterm: 1, index: 11] sent MsgVote request to 2 at term 4
  INFO 1 [logterm: 1, index: 11] sent MsgVote request to 3 at term 4
  3->1 MsgPreVoteResp Term:4 Log:0/0
> 1 handling Ready
  Ready MustSync=true:
  State:StateCandidate
  HardState Term:4 Vote:1 Commit:11 Lead:0 LeadEpoch:0
  Messages:
  1->2 MsgVote Term:4 Log:1/11
  1->3 MsgVote Term:4 Log:1/11
  INFO 1 received MsgVoteResp from 1 at term 4
  INFO 1 has received 1 MsgVoteResp votes and 0 vote rejections
> 2 receiving messages
  1->2 MsgVote Term:4 Log:1/11
  INFO 2 [term: 1] received a MsgVote message with higher term from 1 [term: 4], advancing term
  INFO 2 became follower at term 4
  DEBUG 2 reset election elapsed to 0
  INFO 2 [logterm: 1, index: 11, vote: 0] cast MsgVote for 1 [logterm: 1, index: 11] at term 4
> 3 receiving messages
  1->3 MsgVote Term:4 Log:1/11
  INFO 3 [term: 3] received a MsgVote message with higher term from 1 [term: 4], advancing term
  INFO 3 became follower at term 4
  DEBUG 3 reset election elapsed to 0
  INFO 3 [logterm: 1, index: 10, vote: 0] cast MsgVote for 1 [logterm: 1, index: 11] at term 4
> 2 handling Ready
  Ready MustSync=true:
  HardState Term:4 Vote:1 Commit:11 Lead:0 LeadEpoch:0
  Messages:
  2->1 MsgVoteResp Term:4 Log:0/0
> 3 handling Ready
  Ready MustSync=true:
  State:StateFollower
  HardState Term:4 Vote:1 Commit:10 Lead:0 LeadEpoch:0
  Messages:
  3->1 MsgVoteResp Term:4 Log:0/0
> 1 receiving messages
  2->1 MsgVoteResp Term:4 Log:0/0
  INFO 1 received MsgVoteResp from 2 at term 4
  INFO 1 has received 2 MsgVoteResp votes and 0 vote rejections
  INFO 1 became leader at term 4
  3->1 MsgVoteResp Term:4 Log:0/0
> 1 handling Ready
  Ready MustSync=true:
  State:StateLeader
  HardState Term:4 Vote:1 Commit:11 Lead:1 LeadEpoch:1
  Entries:
  4/12 EntryNormal ""
  Messages:
  1->2 MsgFortifyLeader Term:4 Log:0/0
  1->3 MsgFortifyLeader Term:4 Log:0/0
  1->2 MsgApp Term:4 Log:1/11 Commit:11 Entries:[4/12 EntryNormal ""]
  1->3 MsgApp Term:4 Log:1/11 Commit:11 Entries:[4/12 EntryNormal ""]
> 2 receiving messages
  1->2 MsgFortifyLeader Term:4 Log:0/0
  1->2 MsgApp Term:4 Log:1/11 Commit:11 Entries:[4/12 EntryNormal ""]
> 3 receiving messages
  1->3 MsgFortifyLeader Term:4 Log:0/0
  1->3 MsgApp Term:4 Log:1/11 Commit:11 Entries:[4/12 EntryNormal ""]
  DEBUG 3 [logterm: 0, index: 11] rejected MsgApp [logterm: 1, index: 11] from 1
> 2 handling Ready
  Ready MustSync=true:
  HardState Term:4 Vote:1 Commit:11 Lead:1 LeadEpoch:1
  Entries:
  4/12 EntryNormal ""
  Messages:
  2->1 MsgFortifyLeaderResp Term:4 Log:0/0 LeadEpoch:1
  2->1 MsgAppResp Term:4 Log:0/12 Commit:11
> 3 handling Ready
  Ready MustSync=true:
  HardState Term:4 Vote:1 Commit:10 Lead:1 LeadEpoch:1
  Messages:
  3->1 MsgFortifyLeaderResp Term:4 Log:0/0 LeadEpoch:1
  3->1 MsgAppResp Term:4 Log:1/11 Rejected (Hint: 10) Commit:10
> 1 receiving messages
  2->1 MsgFortifyLeaderResp Term:4 Log:0/0 LeadEpoch:1
  2->1 MsgAppResp Term:4 Log:0/12 Commit:11
  3->1 MsgFortifyLeaderResp Term:4 Log:0/0 LeadEpoch:1
  3->1 MsgAppResp Term:4 Log:1/11 Rejected (Hint: 10) Commit:10
  DEBUG 1 received MsgAppResp(rejected, hint: (index 10, term 1)) from 3 for index 11
  DEBUG 1 decreased progress of 3 to [StateProbe match=0 next=11 sentCommit=10 matchCommit=10]
> 1 handling Ready
  Ready MustSync=true:
  HardState Term:4 Vote:1 Commit:12 Lead:1 LeadEpoch:1
  CommittedEntries:
  4/12 EntryNormal ""
  Messages:
  1->2 MsgApp Term:4 Log:1/11 Commit:11 Entries:[4/12 EntryNormal ""]
  1->2 MsgApp Term:4 Log:4/12 Commit:12
  1->3 MsgApp Term:4 Log:1/11 Commit:12 Entries:[4/12 EntryNormal ""]
  1->3 MsgApp Term:4 Log:1/10 Commit:12 Entries:[
    1/11 EntryNormal ""
    4/12 EntryNormal ""
  ]
> 2 receiving messages
  1->2 MsgApp Term:4 Log:1/11 Commit:11 Entries:[4/12 EntryNormal ""]
  1->2 MsgApp Term:4 Log:4/12 Commit:12
> 3 receiving messages
  1->3 MsgApp Term:4 Log:1/11 Commit:12 Entries:[4/12 EntryNormal ""]
  DEBUG 3 [logterm: 0, index: 11] rejected MsgApp [logterm: 1, index: 11] from 1
  1->3 MsgApp Term:4 Log:1/10 Commit:12 Entries:[
    1/11 EntryNormal ""
    4/12 EntryNormal ""
  ]
> 2 handling Ready
  Ready MustSync=true:
  HardState Term:4 Vote:1 Commit:12 Lead:1 LeadEpoch:1
  CommittedEntries:
  4/12 EntryNormal ""
  Messages:
  2->1 MsgAppResp Term:4 Log:0/12 Commit:11
  2->1 MsgAppResp Term:4 Log:0/12 Commit:12
> 3 handling Ready
  Ready MustSync=true:
  HardState Term:4 Vote:1 Commit:12 Lead:1 LeadEpoch:1
  Entries:
  1/11 EntryNormal ""
  4/12 EntryNormal ""
  CommittedEntries:
  1/11 EntryNormal ""
  4/12 EntryNormal ""
  Messages:
  3->1 MsgAppResp Term:4 Log:1/11 Rejected (Hint: 10) Commit:10
  3->1 MsgAppResp Term:4 Log:0/12 Commit:12
> 1 receiving messages
  2->1 MsgAppResp Term:4 Log:0/12 Commit:11
  2->1 MsgAppResp Term:4 Log:0/12 Commit:12
  3->1 MsgAppResp Term:4 Log:1/11 Rejected (Hint: 10) Commit:10
  DEBUG 1 received MsgAppResp(rejected, hint: (index 10, term 1)) from 3 for index 11
  3->1 MsgAppResp Term:4 Log:0/12 Commit:12

raft-state
----
1: StateLeader (Voter) Term:4 Lead:1 LeadEpoch:1
2: StateFollower (Voter) Term:4 Lead:1 LeadEpoch:1
3: StateFollower (Voter) Term:4 Lead:1 LeadEpoch:1
