...

Text file src/go.etcd.io/etcd/raft/v3/testdata/confchange_v2_add_double_implicit.txt

Documentation: go.etcd.io/etcd/raft/v3/testdata

     1# Run a V2 membership change that adds a single voter but explicitly asks for the
     2# use of joint consensus (with auto-leaving).
     3
     4# TODO(tbg): also verify that if the leader changes while in the joint state, the
     5# new leader will auto-transition out of the joint state just the same.
     6
     7# Bootstrap n1.
     8add-nodes 1 voters=(1) index=2
     9----
    10INFO 1 switched to configuration voters=(1)
    11INFO 1 became follower at term 0
    12INFO newRaft 1 [peers: [1], term: 0, commit: 2, applied: 2, lastindex: 2, lastterm: 1]
    13
    14campaign 1
    15----
    16INFO 1 is starting a new election at term 0
    17INFO 1 became candidate at term 1
    18INFO 1 received MsgVoteResp from 1 at term 1
    19INFO 1 became leader at term 1
    20
    21propose-conf-change 1 transition=implicit
    22v2
    23----
    24ok
    25
    26# Add n2.
    27add-nodes 1
    28----
    29INFO 2 switched to configuration voters=()
    30INFO 2 became follower at term 0
    31INFO newRaft 2 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
    32
    33# n1 commits the conf change using itself as commit quorum, then starts catching up n2.
    34# When that's done, it starts auto-transitioning out. Note that the snapshots propagating
    35# the joint config have the AutoLeave flag set in their config.
    36stabilize 1 2
    37----
    38> 1 handling Ready
    39  Ready MustSync=true:
    40  Lead:1 State:StateLeader
    41  HardState Term:1 Vote:1 Commit:4
    42  Entries:
    43  1/3 EntryNormal ""
    44  1/4 EntryConfChangeV2 v2
    45  CommittedEntries:
    46  1/3 EntryNormal ""
    47  1/4 EntryConfChangeV2 v2
    48  INFO 1 switched to configuration voters=(1 2)&&(1) autoleave
    49  INFO initiating automatic transition out of joint configuration voters=(1 2)&&(1) autoleave
    50> 1 handling Ready
    51  Ready MustSync=true:
    52  Entries:
    53  1/5 EntryConfChangeV2
    54  Messages:
    55  1->2 MsgApp Term:1 Log:1/3 Commit:4 Entries:[1/4 EntryConfChangeV2 v2]
    56> 2 receiving messages
    57  1->2 MsgApp Term:1 Log:1/3 Commit:4 Entries:[1/4 EntryConfChangeV2 v2]
    58  INFO 2 [term: 0] received a MsgApp message with higher term from 1 [term: 1]
    59  INFO 2 became follower at term 1
    60  DEBUG 2 [logterm: 0, index: 3] rejected MsgApp [logterm: 1, index: 3] from 1
    61> 2 handling Ready
    62  Ready MustSync=true:
    63  Lead:1 State:StateFollower
    64  HardState Term:1 Commit:0
    65  Messages:
    66  2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0)
    67> 1 receiving messages
    68  2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0)
    69  DEBUG 1 received MsgAppResp(rejected, hint: (index 0, term 0)) from 2 for index 3
    70  DEBUG 1 decreased progress of 2 to [StateProbe match=0 next=1]
    71  DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 next=1]
    72  DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 next=1 paused pendingSnap=4]
    73> 1 handling Ready
    74  Ready MustSync=false:
    75  Messages:
    76  1->2 MsgSnap Term:1 Log:0/0 Snapshot: Index:4 Term:1 ConfState:Voters:[1 2] VotersOutgoing:[1] Learners:[] LearnersNext:[] AutoLeave:true
    77> 2 receiving messages
    78  1->2 MsgSnap Term:1 Log:0/0 Snapshot: Index:4 Term:1 ConfState:Voters:[1 2] VotersOutgoing:[1] Learners:[] LearnersNext:[] AutoLeave:true
    79  INFO log [committed=0, applied=0, unstable.offset=1, len(unstable.Entries)=0] starts to restore snapshot [index: 4, term: 1]
    80  INFO 2 switched to configuration voters=(1 2)&&(1) autoleave
    81  INFO 2 [commit: 4, lastindex: 4, lastterm: 1] restored snapshot [index: 4, term: 1]
    82  INFO 2 [commit: 4] restored snapshot [index: 4, term: 1]
    83> 2 handling Ready
    84  Ready MustSync=false:
    85  HardState Term:1 Commit:4
    86  Snapshot Index:4 Term:1 ConfState:Voters:[1 2] VotersOutgoing:[1] Learners:[] LearnersNext:[] AutoLeave:true
    87  Messages:
    88  2->1 MsgAppResp Term:1 Log:0/4
    89> 1 receiving messages
    90  2->1 MsgAppResp Term:1 Log:0/4
    91  DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 next=5 paused pendingSnap=4]
    92> 1 handling Ready
    93  Ready MustSync=false:
    94  Messages:
    95  1->2 MsgApp Term:1 Log:1/4 Commit:4 Entries:[1/5 EntryConfChangeV2]
    96> 2 receiving messages
    97  1->2 MsgApp Term:1 Log:1/4 Commit:4 Entries:[1/5 EntryConfChangeV2]
    98> 2 handling Ready
    99  Ready MustSync=true:
   100  Entries:
   101  1/5 EntryConfChangeV2
   102  Messages:
   103  2->1 MsgAppResp Term:1 Log:0/5
   104> 1 receiving messages
   105  2->1 MsgAppResp Term:1 Log:0/5
   106> 1 handling Ready
   107  Ready MustSync=false:
   108  HardState Term:1 Vote:1 Commit:5
   109  CommittedEntries:
   110  1/5 EntryConfChangeV2
   111  Messages:
   112  1->2 MsgApp Term:1 Log:1/5 Commit:5
   113  INFO 1 switched to configuration voters=(1 2)
   114> 2 receiving messages
   115  1->2 MsgApp Term:1 Log:1/5 Commit:5
   116> 2 handling Ready
   117  Ready MustSync=false:
   118  HardState Term:1 Commit:5
   119  CommittedEntries:
   120  1/5 EntryConfChangeV2
   121  Messages:
   122  2->1 MsgAppResp Term:1 Log:0/5
   123  INFO 2 switched to configuration voters=(1 2)
   124> 1 receiving messages
   125  2->1 MsgAppResp Term:1 Log:0/5

View as plain text