diff --git a/confchange/testdata/joint_autoleave.txt b/confchange/testdata/joint_autoleave.txt index 9ec8cb0a..8c9810e8 100644 --- a/confchange/testdata/joint_autoleave.txt +++ b/confchange/testdata/joint_autoleave.txt @@ -5,16 +5,16 @@ simple v1 ---- voters=(1) -1: StateProbe match=0 next=0 +1: StateProbe match=0 commit=0 next=0 # Autoleave is reflected in the config. enter-joint autoleave=true v2 v3 ---- voters=(1 2 3)&&(1) autoleave -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 -3: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 +3: StateProbe match=0 commit=0 next=1 # Can't enter-joint twice, even if autoleave changes. enter-joint autoleave=false @@ -24,6 +24,6 @@ config is already joint leave-joint ---- voters=(1 2 3) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 -3: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 +3: StateProbe match=0 commit=0 next=1 diff --git a/confchange/testdata/joint_idempotency.txt b/confchange/testdata/joint_idempotency.txt index 6d1346b7..2597c1f4 100644 --- a/confchange/testdata/joint_idempotency.txt +++ b/confchange/testdata/joint_idempotency.txt @@ -5,19 +5,19 @@ simple v1 ---- voters=(1) -1: StateProbe match=0 next=0 +1: StateProbe match=0 commit=0 next=0 enter-joint r1 r2 r9 v2 v3 v4 v2 v3 v4 l2 l2 r4 r4 l1 l1 ---- voters=(3)&&(1) learners=(2) learners_next=(1) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 learner -3: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 learner +3: StateProbe match=0 commit=0 next=1 leave-joint ---- voters=(3) learners=(1 2) -1: StateProbe match=0 next=0 learner -2: StateProbe match=0 next=1 learner -3: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 learner +2: StateProbe match=0 commit=0 next=1 learner +3: StateProbe match=0 commit=0 next=1 diff --git a/confchange/testdata/joint_learners_next.txt b/confchange/testdata/joint_learners_next.txt index df1da7d0..ced54591 100644 --- a/confchange/testdata/joint_learners_next.txt +++ b/confchange/testdata/joint_learners_next.txt @@ -8,17 +8,17 @@ simple v1 ---- voters=(1) -1: StateProbe match=0 next=0 +1: StateProbe match=0 commit=0 next=0 enter-joint v2 l1 ---- voters=(2)&&(1) learners_next=(1) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 leave-joint ---- voters=(2) learners=(1) -1: StateProbe match=0 next=0 learner -2: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 learner +2: StateProbe match=0 commit=0 next=1 diff --git a/confchange/testdata/joint_safety.txt b/confchange/testdata/joint_safety.txt index 75d11b19..7c418a8e 100644 --- a/confchange/testdata/joint_safety.txt +++ b/confchange/testdata/joint_safety.txt @@ -15,7 +15,7 @@ simple v1 ---- voters=(1) -1: StateProbe match=0 next=3 +1: StateProbe match=0 commit=0 next=3 leave-joint ---- @@ -25,7 +25,7 @@ can't leave a non-joint config enter-joint ---- voters=(1)&&(1) -1: StateProbe match=0 next=3 +1: StateProbe match=0 commit=0 next=3 enter-joint ---- @@ -34,7 +34,7 @@ config is already joint leave-joint ---- voters=(1) -1: StateProbe match=0 next=3 +1: StateProbe match=0 commit=0 next=3 leave-joint ---- @@ -45,10 +45,10 @@ enter-joint r1 v2 v3 l4 ---- voters=(2 3)&&(1) learners=(4) -1: StateProbe match=0 next=3 -2: StateProbe match=0 next=9 -3: StateProbe match=0 next=9 -4: StateProbe match=0 next=9 learner +1: StateProbe match=0 commit=0 next=3 +2: StateProbe match=0 commit=0 next=9 +3: StateProbe match=0 commit=0 next=9 +4: StateProbe match=0 commit=0 next=9 learner enter-joint ---- @@ -67,15 +67,15 @@ can't apply simple config change in joint config leave-joint ---- voters=(2 3) learners=(4) -2: StateProbe match=0 next=9 -3: StateProbe match=0 next=9 -4: StateProbe match=0 next=9 learner +2: StateProbe match=0 commit=0 next=9 +3: StateProbe match=0 commit=0 next=9 +4: StateProbe match=0 commit=0 next=9 learner simple l9 ---- voters=(2 3) learners=(4 9) -2: StateProbe match=0 next=9 -3: StateProbe match=0 next=9 -4: StateProbe match=0 next=9 learner -9: StateProbe match=0 next=14 learner +2: StateProbe match=0 commit=0 next=9 +3: StateProbe match=0 commit=0 next=9 +4: StateProbe match=0 commit=0 next=9 learner +9: StateProbe match=0 commit=0 next=14 learner diff --git a/confchange/testdata/simple_idempotency.txt b/confchange/testdata/simple_idempotency.txt index 2f7ca2e2..db759893 100644 --- a/confchange/testdata/simple_idempotency.txt +++ b/confchange/testdata/simple_idempotency.txt @@ -2,68 +2,68 @@ simple v1 ---- voters=(1) -1: StateProbe match=0 next=0 +1: StateProbe match=0 commit=0 next=0 simple v1 ---- voters=(1) -1: StateProbe match=0 next=0 +1: StateProbe match=0 commit=0 next=0 simple v2 ---- voters=(1 2) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=2 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=2 simple l1 ---- voters=(2) learners=(1) -1: StateProbe match=0 next=0 learner -2: StateProbe match=0 next=2 +1: StateProbe match=0 commit=0 next=0 learner +2: StateProbe match=0 commit=0 next=2 simple l1 ---- voters=(2) learners=(1) -1: StateProbe match=0 next=0 learner -2: StateProbe match=0 next=2 +1: StateProbe match=0 commit=0 next=0 learner +2: StateProbe match=0 commit=0 next=2 simple r1 ---- voters=(2) -2: StateProbe match=0 next=2 +2: StateProbe match=0 commit=0 next=2 simple r1 ---- voters=(2) -2: StateProbe match=0 next=2 +2: StateProbe match=0 commit=0 next=2 simple v3 ---- voters=(2 3) -2: StateProbe match=0 next=2 -3: StateProbe match=0 next=7 +2: StateProbe match=0 commit=0 next=2 +3: StateProbe match=0 commit=0 next=7 simple r3 ---- voters=(2) -2: StateProbe match=0 next=2 +2: StateProbe match=0 commit=0 next=2 simple r3 ---- voters=(2) -2: StateProbe match=0 next=2 +2: StateProbe match=0 commit=0 next=2 simple r4 ---- voters=(2) -2: StateProbe match=0 next=2 +2: StateProbe match=0 commit=0 next=2 diff --git a/confchange/testdata/simple_promote_demote.txt b/confchange/testdata/simple_promote_demote.txt index 52369b45..1767aa58 100644 --- a/confchange/testdata/simple_promote_demote.txt +++ b/confchange/testdata/simple_promote_demote.txt @@ -4,22 +4,22 @@ simple v1 ---- voters=(1) -1: StateProbe match=0 next=0 +1: StateProbe match=0 commit=0 next=0 simple v2 ---- voters=(1 2) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 simple v3 ---- voters=(1 2 3) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 -3: StateProbe match=0 next=2 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 +3: StateProbe match=0 commit=0 next=2 # Can atomically demote and promote without a hitch. # This is pointless, but possible. @@ -27,18 +27,18 @@ simple l1 v1 ---- voters=(1 2 3) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 -3: StateProbe match=0 next=2 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 +3: StateProbe match=0 commit=0 next=2 # Can demote a voter. simple l2 ---- voters=(1 3) learners=(2) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 learner -3: StateProbe match=0 next=2 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 learner +3: StateProbe match=0 commit=0 next=2 # Can atomically promote and demote the same voter. # This is pointless, but possible. @@ -46,15 +46,15 @@ simple v2 l2 ---- voters=(1 3) learners=(2) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 learner -3: StateProbe match=0 next=2 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 learner +3: StateProbe match=0 commit=0 next=2 # Can promote a voter. simple v2 ---- voters=(1 2 3) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 -3: StateProbe match=0 next=2 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 +3: StateProbe match=0 commit=0 next=2 diff --git a/confchange/testdata/simple_safety.txt b/confchange/testdata/simple_safety.txt index 6566c5fc..42f30350 100644 --- a/confchange/testdata/simple_safety.txt +++ b/confchange/testdata/simple_safety.txt @@ -7,15 +7,15 @@ simple v1 ---- voters=(1) -1: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=1 simple v2 l3 ---- voters=(1 2) learners=(3) -1: StateProbe match=0 next=1 -2: StateProbe match=0 next=2 -3: StateProbe match=0 next=2 learner +1: StateProbe match=0 commit=0 next=1 +2: StateProbe match=0 commit=0 next=2 +3: StateProbe match=0 commit=0 next=2 learner simple r1 v5 @@ -46,11 +46,11 @@ simple l2 l3 l4 l5 ---- voters=(1) learners=(2 3 4 5) -1: StateProbe match=0 next=1 -2: StateProbe match=0 next=2 learner -3: StateProbe match=0 next=2 learner -4: StateProbe match=0 next=8 learner -5: StateProbe match=0 next=8 learner +1: StateProbe match=0 commit=0 next=1 +2: StateProbe match=0 commit=0 next=2 learner +3: StateProbe match=0 commit=0 next=2 learner +4: StateProbe match=0 commit=0 next=8 learner +5: StateProbe match=0 commit=0 next=8 learner simple r1 @@ -61,4 +61,4 @@ simple r2 r3 r4 r5 ---- voters=(1) -1: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=1 diff --git a/confchange/testdata/update.txt b/confchange/testdata/update.txt index 50a703cc..c9a44b3a 100644 --- a/confchange/testdata/update.txt +++ b/confchange/testdata/update.txt @@ -6,18 +6,18 @@ simple v1 ---- voters=(1) -1: StateProbe match=0 next=0 +1: StateProbe match=0 commit=0 next=0 simple v2 u1 ---- voters=(1 2) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 simple u1 u2 u3 u1 u2 u3 ---- voters=(1 2) -1: StateProbe match=0 next=0 -2: StateProbe match=0 next=1 +1: StateProbe match=0 commit=0 next=0 +2: StateProbe match=0 commit=0 next=1 diff --git a/confchange/testdata/zero.txt b/confchange/testdata/zero.txt index 5e0d46fe..dad62b08 100644 --- a/confchange/testdata/zero.txt +++ b/confchange/testdata/zero.txt @@ -3,4 +3,4 @@ simple v1 r0 v0 l0 ---- voters=(1) -1: StateProbe match=0 next=0 +1: StateProbe match=0 commit=0 next=0 diff --git a/testdata/campaign_learner_must_vote.txt b/testdata/campaign_learner_must_vote.txt index 734422b8..262a424e 100644 --- a/testdata/campaign_learner_must_vote.txt +++ b/testdata/campaign_learner_must_vote.txt @@ -113,7 +113,7 @@ stabilize 2 3 > 2 receiving messages 3->2 MsgAppResp Term:2 Log:1/4 Rejected (Hint: 3) DEBUG 2 received MsgAppResp(rejected, hint: (index 3, term 1)) from 3 for index 4 - DEBUG 2 decreased progress of 3 to [StateProbe match=0 next=4] + DEBUG 2 decreased progress of 3 to [StateProbe match=0 commit=0 next=4] > 2 handling Ready Ready MustSync=false: Messages: diff --git a/testdata/confchange_v1_add_single.txt b/testdata/confchange_v1_add_single.txt index e9469ed7..9459d092 100644 --- a/testdata/confchange_v1_add_single.txt +++ b/testdata/confchange_v1_add_single.txt @@ -70,9 +70,9 @@ stabilize > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0) DEBUG 1 received MsgAppResp(rejected, hint: (index 0, term 0)) from 2 for index 3 - DEBUG 1 decreased progress of 2 to [StateProbe match=0 next=1] - DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 next=1] - DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 next=1 paused pendingSnap=4] + DEBUG 1 decreased progress of 2 to [StateProbe match=0 commit=0 next=1] + DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 commit=0 next=1] + DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 commit=0 next=1 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: @@ -91,7 +91,7 @@ stabilize 2->1 MsgAppResp Term:1 Log:0/4 > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/4 - DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 next=5 paused pendingSnap=4] + DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 commit=0 next=5 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: diff --git a/testdata/confchange_v2_add_double_auto.txt b/testdata/confchange_v2_add_double_auto.txt index 78b5a2bc..d89b9095 100644 --- a/testdata/confchange_v2_add_double_auto.txt +++ b/testdata/confchange_v2_add_double_auto.txt @@ -93,9 +93,9 @@ stabilize 1 2 > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0) DEBUG 1 received MsgAppResp(rejected, hint: (index 0, term 0)) from 2 for index 3 - DEBUG 1 decreased progress of 2 to [StateProbe match=0 next=1] - DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 next=1] - DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 next=1 paused pendingSnap=4] + DEBUG 1 decreased progress of 2 to [StateProbe match=0 commit=0 next=1] + DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 commit=0 next=1] + DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 commit=0 next=1 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: @@ -114,7 +114,7 @@ stabilize 1 2 2->1 MsgAppResp Term:1 Log:0/4 > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/4 - DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 next=5 paused pendingSnap=4] + DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 commit=0 next=5 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: @@ -167,9 +167,9 @@ stabilize 1 3 > 1 receiving messages 3->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0) DEBUG 1 received MsgAppResp(rejected, hint: (index 0, term 0)) from 3 for index 3 - DEBUG 1 decreased progress of 3 to [StateProbe match=0 next=1] - DEBUG 1 [firstindex: 3, commit: 5] sent snapshot[index: 5, term: 1] to 3 [StateProbe match=0 next=1] - DEBUG 1 paused sending replication messages to 3 [StateSnapshot match=0 next=1 paused pendingSnap=5] + DEBUG 1 decreased progress of 3 to [StateProbe match=0 commit=0 next=1] + DEBUG 1 [firstindex: 3, commit: 5] sent snapshot[index: 5, term: 1] to 3 [StateProbe match=0 commit=0 next=1] + DEBUG 1 paused sending replication messages to 3 [StateSnapshot match=0 commit=0 next=1 paused pendingSnap=5] > 1 handling Ready Ready MustSync=false: Messages: @@ -188,7 +188,7 @@ stabilize 1 3 3->1 MsgAppResp Term:1 Log:0/5 > 1 receiving messages 3->1 MsgAppResp Term:1 Log:0/5 - DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 3 [StateSnapshot match=5 next=6 paused pendingSnap=5] + DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 3 [StateSnapshot match=5 commit=0 next=6 paused pendingSnap=5] > 1 handling Ready Ready MustSync=false: Messages: diff --git a/testdata/confchange_v2_add_double_implicit.txt b/testdata/confchange_v2_add_double_implicit.txt index 7d27151f..cf6a77fe 100644 --- a/testdata/confchange_v2_add_double_implicit.txt +++ b/testdata/confchange_v2_add_double_implicit.txt @@ -76,9 +76,9 @@ stabilize 1 2 > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0) DEBUG 1 received MsgAppResp(rejected, hint: (index 0, term 0)) from 2 for index 3 - DEBUG 1 decreased progress of 2 to [StateProbe match=0 next=1] - DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 next=1] - DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 next=1 paused pendingSnap=4] + DEBUG 1 decreased progress of 2 to [StateProbe match=0 commit=0 next=1] + DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 commit=0 next=1] + DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 commit=0 next=1 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: @@ -97,7 +97,7 @@ stabilize 1 2 2->1 MsgAppResp Term:1 Log:0/4 > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/4 - DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 next=5 paused pendingSnap=4] + DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 commit=0 next=5 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: diff --git a/testdata/confchange_v2_add_single_auto.txt b/testdata/confchange_v2_add_single_auto.txt index 666ddb52..7dce91ac 100644 --- a/testdata/confchange_v2_add_single_auto.txt +++ b/testdata/confchange_v2_add_single_auto.txt @@ -71,9 +71,9 @@ stabilize > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0) DEBUG 1 received MsgAppResp(rejected, hint: (index 0, term 0)) from 2 for index 3 - DEBUG 1 decreased progress of 2 to [StateProbe match=0 next=1] - DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 next=1] - DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 next=1 paused pendingSnap=4] + DEBUG 1 decreased progress of 2 to [StateProbe match=0 commit=0 next=1] + DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 commit=0 next=1] + DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 commit=0 next=1 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: @@ -92,7 +92,7 @@ stabilize 2->1 MsgAppResp Term:1 Log:0/4 > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/4 - DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 next=5 paused pendingSnap=4] + DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 commit=0 next=5 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: diff --git a/testdata/confchange_v2_add_single_explicit.txt b/testdata/confchange_v2_add_single_explicit.txt index 4c83d5f1..11ff48ed 100644 --- a/testdata/confchange_v2_add_single_explicit.txt +++ b/testdata/confchange_v2_add_single_explicit.txt @@ -71,9 +71,9 @@ stabilize 1 2 > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0) DEBUG 1 received MsgAppResp(rejected, hint: (index 0, term 0)) from 2 for index 3 - DEBUG 1 decreased progress of 2 to [StateProbe match=0 next=1] - DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 next=1] - DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 next=1 paused pendingSnap=4] + DEBUG 1 decreased progress of 2 to [StateProbe match=0 commit=0 next=1] + DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 commit=0 next=1] + DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 commit=0 next=1 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: @@ -92,7 +92,7 @@ stabilize 1 2 2->1 MsgAppResp Term:1 Log:0/4 > 1 receiving messages 2->1 MsgAppResp Term:1 Log:0/4 - DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 next=5 paused pendingSnap=4] + DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 commit=0 next=5 paused pendingSnap=4] > 1 handling Ready Ready MustSync=false: Messages: diff --git a/testdata/heartbeat_resp_recovers_from_probing.txt b/testdata/heartbeat_resp_recovers_from_probing.txt index bb6eef1e..e94a67a1 100644 --- a/testdata/heartbeat_resp_recovers_from_probing.txt +++ b/testdata/heartbeat_resp_recovers_from_probing.txt @@ -28,20 +28,20 @@ ok status 1 ---- -1: StateReplicate match=11 next=12 -2: StateReplicate match=11 next=12 -3: StateReplicate match=11 next=12 +1: StateReplicate match=11 commit=10 next=12 +2: StateReplicate match=11 commit=11 next=12 +3: StateReplicate match=11 commit=11 next=12 # On the first replica, report the second one as not reachable. report-unreachable 1 2 ---- -DEBUG 1 failed to send message to 2 because it is unreachable [StateProbe match=11 next=12] +DEBUG 1 failed to send message to 2 because it is unreachable [StateProbe match=11 commit=11 next=12] status 1 ---- -1: StateReplicate match=11 next=12 -2: StateProbe match=11 next=12 -3: StateReplicate match=11 next=12 +1: StateReplicate match=11 commit=10 next=12 +2: StateProbe match=11 commit=11 next=12 +3: StateReplicate match=11 commit=11 next=12 tick-heartbeat 1 ---- @@ -85,6 +85,6 @@ stabilize status 1 ---- -1: StateReplicate match=11 next=12 -2: StateReplicate match=11 next=12 -3: StateReplicate match=11 next=12 +1: StateReplicate match=11 commit=10 next=12 +2: StateReplicate match=11 commit=11 next=12 +3: StateReplicate match=11 commit=11 next=12 diff --git a/testdata/replicate_pause.txt b/testdata/replicate_pause.txt index d9cee59f..b9a359bf 100644 --- a/testdata/replicate_pause.txt +++ b/testdata/replicate_pause.txt @@ -46,9 +46,9 @@ ok # Expect that in-flight tracking to nodes 2 and 3 is saturated. status 1 ---- -1: StateReplicate match=14 next=15 -2: StateReplicate match=11 next=15 paused inflight=3[full] -3: StateReplicate match=11 next=15 paused inflight=3[full] +1: StateReplicate match=14 commit=11 next=15 +2: StateReplicate match=11 commit=11 next=15 paused inflight=3[full] +3: StateReplicate match=11 commit=11 next=15 paused inflight=3[full] log-level none ---- @@ -66,9 +66,9 @@ ok # Expect that the entries are committed and stored on nodes 1 and 2. status 1 ---- -1: StateReplicate match=14 next=15 -2: StateReplicate match=14 next=15 -3: StateReplicate match=11 next=15 paused inflight=3[full] +1: StateReplicate match=14 commit=11 next=15 +2: StateReplicate match=14 commit=14 next=15 +3: StateReplicate match=11 commit=11 next=15 paused inflight=3[full] # Drop append messages to node 3. deliver-msgs drop=3 @@ -94,9 +94,9 @@ ok # In-flight tracking to nodes 2 and 3 is saturated, but node 3 is behind. status 1 ---- -1: StateReplicate match=14 next=15 -2: StateReplicate match=14 next=18 paused inflight=3[full] -3: StateReplicate match=11 next=15 paused inflight=3[full] +1: StateReplicate match=14 commit=11 next=15 +2: StateReplicate match=14 commit=14 next=18 paused inflight=3[full] +3: StateReplicate match=11 commit=11 next=15 paused inflight=3[full] log-level none ---- @@ -114,9 +114,9 @@ ok # Expect that the entries are committed and stored only on nodes 1 and 2. status 1 ---- -1: StateReplicate match=17 next=18 -2: StateReplicate match=17 next=18 -3: StateReplicate match=11 next=15 paused inflight=3[full] +1: StateReplicate match=17 commit=14 next=18 +2: StateReplicate match=17 commit=17 next=18 +3: StateReplicate match=11 commit=11 next=15 paused inflight=3[full] # Make a heartbeat roundtrip. tick-heartbeat 1 @@ -185,6 +185,6 @@ ok # Eventually all nodes catch up on the committed state. status 1 ---- -1: StateReplicate match=17 next=18 -2: StateReplicate match=17 next=18 -3: StateReplicate match=17 next=18 +1: StateReplicate match=17 commit=14 next=18 +2: StateReplicate match=17 commit=17 next=18 +3: StateReplicate match=17 commit=17 next=18 diff --git a/testdata/slow_follower_after_compaction.txt b/testdata/slow_follower_after_compaction.txt index 0d3d48c8..d23820ae 100644 --- a/testdata/slow_follower_after_compaction.txt +++ b/testdata/slow_follower_after_compaction.txt @@ -43,9 +43,9 @@ ok # All nodes up-to-date. status 1 ---- -1: StateReplicate match=14 next=15 -2: StateReplicate match=14 next=15 -3: StateReplicate match=14 next=15 +1: StateReplicate match=14 commit=11 next=15 +2: StateReplicate match=14 commit=14 next=15 +3: StateReplicate match=14 commit=14 next=15 log-level none ---- @@ -79,9 +79,9 @@ ok # Nodes 1 and 2 up-to-date, 3 is behind and MsgApp flow is throttled. status 1 ---- -1: StateReplicate match=18 next=19 -2: StateReplicate match=18 next=19 -3: StateReplicate match=14 next=17 paused inflight=2[full] +1: StateReplicate match=18 commit=14 next=19 +2: StateReplicate match=18 commit=18 next=19 +3: StateReplicate match=14 commit=14 next=17 paused inflight=2[full] # Break the MsgApp flow from the leader to node 3. deliver-msgs drop=3 @@ -116,6 +116,6 @@ ok # All nodes caught up. status 1 ---- -1: StateReplicate match=18 next=19 -2: StateReplicate match=18 next=19 -3: StateReplicate match=18 next=19 +1: StateReplicate match=18 commit=14 next=19 +2: StateReplicate match=18 commit=18 next=19 +3: StateReplicate match=18 commit=18 next=19 diff --git a/testdata/snapshot_succeed_via_app_resp.txt b/testdata/snapshot_succeed_via_app_resp.txt index 37917403..59ddd2e0 100644 --- a/testdata/snapshot_succeed_via_app_resp.txt +++ b/testdata/snapshot_succeed_via_app_resp.txt @@ -41,9 +41,9 @@ ok status 1 ---- -1: StateReplicate match=11 next=12 -2: StateReplicate match=11 next=12 -3: StateProbe match=0 next=11 paused inactive +1: StateReplicate match=11 commit=10 next=12 +2: StateReplicate match=11 commit=11 next=12 +3: StateProbe match=0 commit=0 next=11 paused inactive # Add the node that will receive a snapshot (it has no state at all, does not # even have a config). @@ -86,8 +86,8 @@ stabilize 1 ---- > 1 receiving messages 3->1 MsgHeartbeatResp Term:1 Log:0/0 - DEBUG 1 [firstindex: 12, commit: 11] sent snapshot[index: 11, term: 1] to 3 [StateProbe match=0 next=11] - DEBUG 1 paused sending replication messages to 3 [StateSnapshot match=0 next=11 paused pendingSnap=11] + DEBUG 1 [firstindex: 12, commit: 11] sent snapshot[index: 11, term: 1] to 3 [StateProbe match=0 commit=0 next=11] + DEBUG 1 paused sending replication messages to 3 [StateSnapshot match=0 commit=0 next=11 paused pendingSnap=11] > 1 handling Ready Ready MustSync=false: Messages: @@ -95,9 +95,9 @@ stabilize 1 status 1 ---- -1: StateReplicate match=11 next=12 -2: StateReplicate match=11 next=12 -3: StateSnapshot match=0 next=11 paused pendingSnap=11 +1: StateReplicate match=11 commit=10 next=12 +2: StateReplicate match=11 commit=11 next=12 +3: StateSnapshot match=0 commit=0 next=11 paused pendingSnap=11 # Follower applies the snapshot. Note how it reacts with a MsgAppResp upon completion. # The snapshot fully catches the follower up (i.e. there are no more log entries it @@ -124,7 +124,7 @@ stabilize 1 ---- > 1 receiving messages 3->1 MsgAppResp Term:1 Log:0/11 - DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 3 [StateSnapshot match=11 next=12 paused pendingSnap=11] + DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 3 [StateSnapshot match=11 commit=0 next=12 paused pendingSnap=11] > 1 handling Ready Ready MustSync=false: Messages: @@ -132,9 +132,9 @@ stabilize 1 status 1 ---- -1: StateReplicate match=11 next=12 -2: StateReplicate match=11 next=12 -3: StateReplicate match=11 next=12 +1: StateReplicate match=11 commit=10 next=12 +2: StateReplicate match=11 commit=11 next=12 +3: StateReplicate match=11 commit=0 next=12 # Let things settle. stabilize diff --git a/testdata/snapshot_succeed_via_app_resp_behind.txt b/testdata/snapshot_succeed_via_app_resp_behind.txt index 09496982..ccf5ee5a 100644 --- a/testdata/snapshot_succeed_via_app_resp_behind.txt +++ b/testdata/snapshot_succeed_via_app_resp_behind.txt @@ -48,9 +48,9 @@ raft-state status 1 ---- -1: StateReplicate match=11 next=12 -2: StateReplicate match=11 next=12 -3: StateProbe match=0 next=11 paused inactive +1: StateReplicate match=11 commit=10 next=12 +2: StateReplicate match=11 commit=11 next=12 +3: StateProbe match=0 commit=0 next=11 paused inactive raft-log 3 ---- @@ -82,9 +82,9 @@ ok status 1 ---- -1: StateReplicate match=12 next=13 -2: StateReplicate match=12 next=13 -3: StateProbe match=0 next=11 paused inactive +1: StateReplicate match=12 commit=11 next=13 +2: StateReplicate match=12 commit=12 next=13 +3: StateProbe match=0 commit=0 next=11 paused inactive # 3 now gets the first MsgApp the leader originally sent, trying to append entry # 11 but this is rejected because the follower's log started at index 5. @@ -120,9 +120,9 @@ stabilize 1 > 1 receiving messages 3->1 MsgAppResp Term:1 Log:1/10 Rejected (Hint: 5) DEBUG 1 received MsgAppResp(rejected, hint: (index 5, term 1)) from 3 for index 10 - DEBUG 1 decreased progress of 3 to [StateProbe match=0 next=6] - DEBUG 1 [firstindex: 11, commit: 12] sent snapshot[index: 12, term: 1] to 3 [StateProbe match=0 next=6] - DEBUG 1 paused sending replication messages to 3 [StateSnapshot match=0 next=6 paused pendingSnap=12] + DEBUG 1 decreased progress of 3 to [StateProbe match=0 commit=0 next=6] + DEBUG 1 [firstindex: 11, commit: 12] sent snapshot[index: 12, term: 1] to 3 [StateProbe match=0 commit=0 next=6] + DEBUG 1 paused sending replication messages to 3 [StateSnapshot match=0 commit=0 next=6 paused pendingSnap=12] > 1 handling Ready Ready MustSync=false: Messages: @@ -148,7 +148,7 @@ stabilize 1 ---- > 1 receiving messages 3->1 MsgAppResp Term:1 Log:0/11 - DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 3 [StateSnapshot match=11 next=12 paused pendingSnap=12] + DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 3 [StateSnapshot match=11 commit=0 next=12 paused pendingSnap=12] > 1 handling Ready Ready MustSync=false: Messages: @@ -158,6 +158,6 @@ stabilize 1 # This is despite its PendingSnapshot having been 12. status 1 ---- -1: StateReplicate match=12 next=13 -2: StateReplicate match=12 next=13 -3: StateReplicate match=11 next=13 inflight=1 +1: StateReplicate match=12 commit=11 next=13 +2: StateReplicate match=12 commit=12 next=13 +3: StateReplicate match=11 commit=0 next=13 inflight=1 diff --git a/tracker/progress.go b/tracker/progress.go index e394395b..38985c80 100644 --- a/tracker/progress.go +++ b/tracker/progress.go @@ -267,7 +267,7 @@ func (pr *Progress) IsPaused() bool { func (pr *Progress) String() string { var buf strings.Builder - fmt.Fprintf(&buf, "%s match=%d next=%d", pr.State, pr.Match, pr.Next) + fmt.Fprintf(&buf, "%s match=%d commit=%d next=%d", pr.State, pr.Match, pr.Commit, pr.Next) if pr.IsLearner { fmt.Fprint(&buf, " learner") } diff --git a/tracker/progress_test.go b/tracker/progress_test.go index 49dedb53..702aef0d 100644 --- a/tracker/progress_test.go +++ b/tracker/progress_test.go @@ -24,8 +24,9 @@ func TestProgressString(t *testing.T) { ins := NewInflights(1, 0) ins.Add(123, 1) pr := &Progress{ - Match: 1, - Next: 2, + Match: 2, + Commit: 1, + Next: 3, State: StateSnapshot, PendingSnapshot: 123, RecentActive: false, @@ -33,7 +34,7 @@ func TestProgressString(t *testing.T) { IsLearner: true, Inflights: ins, } - const exp = `StateSnapshot match=1 next=2 learner paused pendingSnap=123 inactive inflight=1[full]` + const exp = `StateSnapshot match=2 commit=1 next=3 learner paused pendingSnap=123 inactive inflight=1[full]` assert.Equal(t, exp, pr.String()) }