confchange_v2_add_double_implicit.txt 4.6 KB

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