confchange_v1_add_single.txt 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Run a V1 membership change that adds a single voter.
  2. # Bootstrap n1.
  3. add-nodes 1 voters=(1) index=2
  4. ----
  5. INFO 1 switched to configuration voters=(1)
  6. INFO 1 became follower at term 0
  7. INFO newRaft 1 [peers: [1], term: 0, commit: 2, applied: 2, lastindex: 2, lastterm: 1]
  8. campaign 1
  9. ----
  10. INFO 1 is starting a new election at term 0
  11. INFO 1 became candidate at term 1
  12. INFO 1 received MsgVoteResp from 1 at term 1
  13. INFO 1 became leader at term 1
  14. # Add v2 (with an auto transition).
  15. propose-conf-change 1 v1=true
  16. v2
  17. ----
  18. ok
  19. # Pull n2 out of thin air.
  20. add-nodes 1
  21. ----
  22. INFO 2 switched to configuration voters=()
  23. INFO 2 became follower at term 0
  24. INFO newRaft 2 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
  25. # n1 commits the conf change using itself as commit quorum, immediately transitions into
  26. # the final config, and catches up n2. Note that it's using an EntryConfChange, not an
  27. # EntryConfChangeV2, so this is compatible with nodes that don't know about V2 conf changes.
  28. stabilize
  29. ----
  30. > 1 handling Ready
  31. Ready MustSync=true:
  32. Lead:1 State:StateLeader
  33. HardState Term:1 Vote:1 Commit:4
  34. Entries:
  35. 1/3 EntryNormal ""
  36. 1/4 EntryConfChange v2
  37. CommittedEntries:
  38. 1/3 EntryNormal ""
  39. 1/4 EntryConfChange v2
  40. INFO 1 switched to configuration voters=(1 2)
  41. > 1 handling Ready
  42. Ready MustSync=false:
  43. Messages:
  44. 1->2 MsgApp Term:1 Log:1/3 Commit:4 Entries:[1/4 EntryConfChange v2]
  45. > 2 receiving messages
  46. 1->2 MsgApp Term:1 Log:1/3 Commit:4 Entries:[1/4 EntryConfChange v2]
  47. INFO 2 [term: 0] received a MsgApp message with higher term from 1 [term: 1]
  48. INFO 2 became follower at term 1
  49. DEBUG 2 [logterm: 0, index: 3] rejected MsgApp [logterm: 1, index: 3] from 1
  50. > 2 handling Ready
  51. Ready MustSync=true:
  52. Lead:1 State:StateFollower
  53. HardState Term:1 Commit:0
  54. Messages:
  55. 2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0)
  56. > 1 receiving messages
  57. 2->1 MsgAppResp Term:1 Log:0/3 Rejected (Hint: 0)
  58. DEBUG 1 received MsgAppResp(MsgApp was rejected, lastindex: 0) from 2 for index 3
  59. DEBUG 1 decreased progress of 2 to [StateProbe match=0 next=1]
  60. DEBUG 1 [firstindex: 3, commit: 4] sent snapshot[index: 4, term: 1] to 2 [StateProbe match=0 next=1]
  61. DEBUG 1 paused sending replication messages to 2 [StateSnapshot match=0 next=1 paused pendingSnap=4]
  62. > 1 handling Ready
  63. Ready MustSync=false:
  64. Messages:
  65. 1->2 MsgSnap Term:1 Log:0/0 Snapshot: Index:4 Term:1 ConfState:Voters:[1 2] VotersOutgoing:[] Learners:[] LearnersNext:[] AutoLeave:false
  66. > 2 receiving messages
  67. 1->2 MsgSnap Term:1 Log:0/0 Snapshot: Index:4 Term:1 ConfState:Voters:[1 2] VotersOutgoing:[] Learners:[] LearnersNext:[] AutoLeave:false
  68. INFO log [committed=0, applied=0, unstable.offset=1, len(unstable.Entries)=0] starts to restore snapshot [index: 4, term: 1]
  69. INFO 2 switched to configuration voters=(1 2)
  70. INFO 2 [commit: 4, lastindex: 4, lastterm: 1] restored snapshot [index: 4, term: 1]
  71. INFO 2 [commit: 4] restored snapshot [index: 4, term: 1]
  72. > 2 handling Ready
  73. Ready MustSync=false:
  74. HardState Term:1 Commit:4
  75. Snapshot Index:4 Term:1 ConfState:Voters:[1 2] VotersOutgoing:[] Learners:[] LearnersNext:[] AutoLeave:false
  76. Messages:
  77. 2->1 MsgAppResp Term:1 Log:0/4
  78. > 1 receiving messages
  79. 2->1 MsgAppResp Term:1 Log:0/4
  80. DEBUG 1 recovered from needing snapshot, resumed sending replication messages to 2 [StateSnapshot match=4 next=5 paused pendingSnap=4]
  81. > 1 handling Ready
  82. Ready MustSync=false:
  83. Messages:
  84. 1->2 MsgApp Term:1 Log:1/4 Commit:4
  85. > 2 receiving messages
  86. 1->2 MsgApp Term:1 Log:1/4 Commit:4
  87. > 2 handling Ready
  88. Ready MustSync=false:
  89. Messages:
  90. 2->1 MsgAppResp Term:1 Log:0/4
  91. > 1 receiving messages
  92. 2->1 MsgAppResp Term:1 Log:0/4