-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
confchange_fortification_safety.txt
369 lines (360 loc) · 11.8 KB
/
confchange_fortification_safety.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# This test verifies that configuration changes are not permitted to compromise
# the safety of leader fortification.
#
# For details, see FortificationTracker.ConfigChangeSafe.
add-nodes 4 voters=(1, 2, 3) index=2
----
INFO 1 switched to configuration voters=(1 2 3)
INFO 1 became follower at term 0
INFO newRaft 1 [peers: [1,2,3], term: 0, commit: 2, applied: 2, lastindex: 2, lastterm: 1]
INFO 2 switched to configuration voters=(1 2 3)
INFO 2 became follower at term 0
INFO newRaft 2 [peers: [1,2,3], term: 0, commit: 2, applied: 2, lastindex: 2, lastterm: 1]
INFO 3 switched to configuration voters=(1 2 3)
INFO 3 became follower at term 0
INFO newRaft 3 [peers: [1,2,3], term: 0, commit: 2, applied: 2, lastindex: 2, lastterm: 1]
INFO 4 switched to configuration voters=(1 2 3)
INFO 4 became follower at term 0
INFO newRaft 4 [peers: [1,2,3], term: 0, commit: 2, applied: 2, lastindex: 2, lastterm: 1]
campaign 1
----
INFO 1 is starting a new election at term 0
INFO 1 became candidate at term 1
INFO 1 [logterm: 1, index: 2] sent MsgVote request to 2 at term 1
INFO 1 [logterm: 1, index: 2] sent MsgVote request to 3 at term 1
stabilize log-level=none
----
ok
# Withdraw store liveness support from 3 for 1 so that the lead support is
# fragile.
withdraw-support 3 1
----
1 2 3 4
1 1 1 1 1
2 1 1 1 1
3 x 1 1 1
4 1 1 1 1
# Add v4.
propose-conf-change 1
v4
----
ok
stabilize 1 2 3
----
> 1 handling Ready
Ready MustSync=true:
Entries:
1/4 EntryConfChangeV2 v4
Messages:
1->2 MsgApp Term:1 Log:1/3 Commit:3 Entries:[1/4 EntryConfChangeV2 v4]
1->3 MsgApp Term:1 Log:1/3 Commit:3 Entries:[1/4 EntryConfChangeV2 v4]
> 2 receiving messages
1->2 MsgApp Term:1 Log:1/3 Commit:3 Entries:[1/4 EntryConfChangeV2 v4]
> 3 receiving messages
1->3 MsgApp Term:1 Log:1/3 Commit:3 Entries:[1/4 EntryConfChangeV2 v4]
> 2 handling Ready
Ready MustSync=true:
Entries:
1/4 EntryConfChangeV2 v4
Messages:
2->1 MsgAppResp Term:1 Log:0/4 Commit:3
> 3 handling Ready
Ready MustSync=true:
Entries:
1/4 EntryConfChangeV2 v4
Messages:
3->1 MsgAppResp Term:1 Log:0/4 Commit:3
> 1 receiving messages
2->1 MsgAppResp Term:1 Log:0/4 Commit:3
3->1 MsgAppResp Term:1 Log:0/4 Commit:3
> 1 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:4 Lead:1 LeadEpoch:1
CommittedEntries:
1/4 EntryConfChangeV2 v4
Messages:
1->2 MsgApp Term:1 Log:1/4 Commit:4
1->3 MsgApp Term:1 Log:1/4 Commit:4
INFO 1 switched to configuration voters=(1 2 3 4)
> 2 receiving messages
1->2 MsgApp Term:1 Log:1/4 Commit:4
> 3 receiving messages
1->3 MsgApp Term:1 Log:1/4 Commit:4
> 1 handling Ready
Ready MustSync=false:
Messages:
1->4 MsgFortifyLeader Term:1 Log:0/0
1->4 MsgApp Term:1 Log:1/3 Commit:4 Entries:[1/4 EntryConfChangeV2 v4]
> 2 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:4 Lead:1 LeadEpoch:1
CommittedEntries:
1/4 EntryConfChangeV2 v4
Messages:
2->1 MsgAppResp Term:1 Log:0/4 Commit:4
INFO 2 switched to configuration voters=(1 2 3 4)
> 3 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:4 Lead:1 LeadEpoch:1
CommittedEntries:
1/4 EntryConfChangeV2 v4
Messages:
3->1 MsgAppResp Term:1 Log:0/4 Commit:4
INFO 3 switched to configuration voters=(1 2 3 4)
> 1 receiving messages
2->1 MsgAppResp Term:1 Log:0/4 Commit:4
3->1 MsgAppResp Term:1 Log:0/4 Commit:4
# Try to demote v2. This should be rejected because v1's lead support under the
# current config has not caught up to the previous config.
propose-conf-change 1
r2 l2
----
INFO 1 ignoring conf change {ConfChangeTransitionAuto [{ConfChangeRemoveNode 2} {ConfChangeAddLearnerNode 2}] []} at config voters=(1 2 3 4): lead support has not caught up to previous configuration
# Fortify v4 so that lead support catches up.
stabilize 1 4
----
> 1 handling Ready
Ready MustSync=true:
Entries:
1/5 EntryNormal ""
Messages:
1->2 MsgApp Term:1 Log:1/4 Commit:4 Entries:[1/5 EntryNormal ""]
1->3 MsgApp Term:1 Log:1/4 Commit:4 Entries:[1/5 EntryNormal ""]
> 4 receiving messages
1->4 MsgFortifyLeader Term:1 Log:0/0
INFO 4 [term: 0] received a MsgFortifyLeader message with higher term from 1 [term: 1]
INFO 4 became follower at term 1
1->4 MsgApp Term:1 Log:1/3 Commit:4 Entries:[1/4 EntryConfChangeV2 v4]
DEBUG 4 [logterm: 0, index: 3] rejected MsgApp [logterm: 1, index: 3] from 1
> 4 handling Ready
Ready MustSync=true:
HardState Term:1 Commit:2 Lead:1 LeadEpoch:1
Messages:
4->1 MsgFortifyLeaderResp Term:1 Log:0/0 LeadEpoch:1
4->1 MsgAppResp Term:1 Log:1/3 Rejected (Hint: 2) Commit:2
> 1 receiving messages
4->1 MsgFortifyLeaderResp Term:1 Log:0/0 LeadEpoch:1
4->1 MsgAppResp Term:1 Log:1/3 Rejected (Hint: 2) Commit:2
DEBUG 1 received MsgAppResp(rejected, hint: (index 2, term 1)) from 4 for index 3
DEBUG 1 decreased progress of 4 to [StateProbe match=0 next=3 sentCommit=2 matchCommit=2]
> 1 handling Ready
Ready MustSync=false:
Messages:
1->4 MsgApp Term:1 Log:1/2 Commit:4 Entries:[
1/3 EntryNormal ""
1/4 EntryConfChangeV2 v4
1/5 EntryNormal ""
]
> 4 receiving messages
1->4 MsgApp Term:1 Log:1/2 Commit:4 Entries:[
1/3 EntryNormal ""
1/4 EntryConfChangeV2 v4
1/5 EntryNormal ""
]
> 4 handling Ready
Ready MustSync=true:
HardState Term:1 Commit:4 Lead:1 LeadEpoch:1
Entries:
1/3 EntryNormal ""
1/4 EntryConfChangeV2 v4
1/5 EntryNormal ""
CommittedEntries:
1/3 EntryNormal ""
1/4 EntryConfChangeV2 v4
Messages:
4->1 MsgAppResp Term:1 Log:0/5 Commit:4
INFO 4 switched to configuration voters=(1 2 3 4)
> 1 receiving messages
4->1 MsgAppResp Term:1 Log:0/5 Commit:4
# Try to demote v2 again. This time, the proposal should be allowed.
propose-conf-change 1
r2 l2
----
ok
stabilize
----
> 1 handling Ready
Ready MustSync=true:
Entries:
1/6 EntryConfChangeV2 r2 l2
Messages:
1->2 MsgApp Term:1 Log:1/5 Commit:4 Entries:[1/6 EntryConfChangeV2 r2 l2]
1->3 MsgApp Term:1 Log:1/5 Commit:4 Entries:[1/6 EntryConfChangeV2 r2 l2]
1->4 MsgApp Term:1 Log:1/5 Commit:4 Entries:[1/6 EntryConfChangeV2 r2 l2]
> 2 receiving messages
1->2 MsgApp Term:1 Log:1/4 Commit:4 Entries:[1/5 EntryNormal ""]
1->2 MsgApp Term:1 Log:1/5 Commit:4 Entries:[1/6 EntryConfChangeV2 r2 l2]
> 3 receiving messages
1->3 MsgApp Term:1 Log:1/4 Commit:4 Entries:[1/5 EntryNormal ""]
1->3 MsgApp Term:1 Log:1/5 Commit:4 Entries:[1/6 EntryConfChangeV2 r2 l2]
> 4 receiving messages
1->4 MsgApp Term:1 Log:1/5 Commit:4 Entries:[1/6 EntryConfChangeV2 r2 l2]
> 2 handling Ready
Ready MustSync=true:
Entries:
1/5 EntryNormal ""
1/6 EntryConfChangeV2 r2 l2
Messages:
2->1 MsgAppResp Term:1 Log:0/5 Commit:4
2->1 MsgAppResp Term:1 Log:0/6 Commit:4
> 3 handling Ready
Ready MustSync=true:
Entries:
1/5 EntryNormal ""
1/6 EntryConfChangeV2 r2 l2
Messages:
3->1 MsgAppResp Term:1 Log:0/5 Commit:4
3->1 MsgAppResp Term:1 Log:0/6 Commit:4
> 4 handling Ready
Ready MustSync=true:
Entries:
1/6 EntryConfChangeV2 r2 l2
Messages:
4->1 MsgAppResp Term:1 Log:0/6 Commit:4
> 1 receiving messages
2->1 MsgAppResp Term:1 Log:0/5 Commit:4
2->1 MsgAppResp Term:1 Log:0/6 Commit:4
3->1 MsgAppResp Term:1 Log:0/5 Commit:4
3->1 MsgAppResp Term:1 Log:0/6 Commit:4
4->1 MsgAppResp Term:1 Log:0/6 Commit:4
> 1 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:6 Lead:1 LeadEpoch:1
CommittedEntries:
1/5 EntryNormal ""
1/6 EntryConfChangeV2 r2 l2
Messages:
1->2 MsgApp Term:1 Log:1/6 Commit:5
1->3 MsgApp Term:1 Log:1/6 Commit:5
1->4 MsgApp Term:1 Log:1/6 Commit:5
1->2 MsgApp Term:1 Log:1/6 Commit:6
1->3 MsgApp Term:1 Log:1/6 Commit:6
1->4 MsgApp Term:1 Log:1/6 Commit:6
INFO 1 switched to configuration voters=(1 3 4)&&(1 2 3 4) learners_next=(2) autoleave
INFO initiating automatic transition out of joint configuration voters=(1 3 4)&&(1 2 3 4) learners_next=(2) autoleave
> 2 receiving messages
1->2 MsgApp Term:1 Log:1/6 Commit:5
1->2 MsgApp Term:1 Log:1/6 Commit:6
> 3 receiving messages
1->3 MsgApp Term:1 Log:1/6 Commit:5
1->3 MsgApp Term:1 Log:1/6 Commit:6
> 4 receiving messages
1->4 MsgApp Term:1 Log:1/6 Commit:5
1->4 MsgApp Term:1 Log:1/6 Commit:6
> 1 handling Ready
Ready MustSync=true:
Entries:
1/7 EntryConfChangeV2
Messages:
1->2 MsgApp Term:1 Log:1/6 Commit:6 Entries:[1/7 EntryConfChangeV2]
1->3 MsgApp Term:1 Log:1/6 Commit:6 Entries:[1/7 EntryConfChangeV2]
1->4 MsgApp Term:1 Log:1/6 Commit:6 Entries:[1/7 EntryConfChangeV2]
> 2 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:6 Lead:1 LeadEpoch:1
CommittedEntries:
1/5 EntryNormal ""
1/6 EntryConfChangeV2 r2 l2
Messages:
2->1 MsgAppResp Term:1 Log:0/6 Commit:5
2->1 MsgAppResp Term:1 Log:0/6 Commit:6
INFO 2 switched to configuration voters=(1 3 4)&&(1 2 3 4) learners_next=(2) autoleave
> 3 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:6 Lead:1 LeadEpoch:1
CommittedEntries:
1/5 EntryNormal ""
1/6 EntryConfChangeV2 r2 l2
Messages:
3->1 MsgAppResp Term:1 Log:0/6 Commit:5
3->1 MsgAppResp Term:1 Log:0/6 Commit:6
INFO 3 switched to configuration voters=(1 3 4)&&(1 2 3 4) learners_next=(2) autoleave
> 4 handling Ready
Ready MustSync=true:
HardState Term:1 Commit:6 Lead:1 LeadEpoch:1
CommittedEntries:
1/5 EntryNormal ""
1/6 EntryConfChangeV2 r2 l2
Messages:
4->1 MsgAppResp Term:1 Log:0/6 Commit:5
4->1 MsgAppResp Term:1 Log:0/6 Commit:6
INFO 4 switched to configuration voters=(1 3 4)&&(1 2 3 4) learners_next=(2) autoleave
> 1 receiving messages
2->1 MsgAppResp Term:1 Log:0/6 Commit:5
2->1 MsgAppResp Term:1 Log:0/6 Commit:6
3->1 MsgAppResp Term:1 Log:0/6 Commit:5
3->1 MsgAppResp Term:1 Log:0/6 Commit:6
4->1 MsgAppResp Term:1 Log:0/6 Commit:5
4->1 MsgAppResp Term:1 Log:0/6 Commit:6
> 2 receiving messages
1->2 MsgApp Term:1 Log:1/6 Commit:6 Entries:[1/7 EntryConfChangeV2]
> 3 receiving messages
1->3 MsgApp Term:1 Log:1/6 Commit:6 Entries:[1/7 EntryConfChangeV2]
> 4 receiving messages
1->4 MsgApp Term:1 Log:1/6 Commit:6 Entries:[1/7 EntryConfChangeV2]
> 2 handling Ready
Ready MustSync=true:
Entries:
1/7 EntryConfChangeV2
Messages:
2->1 MsgAppResp Term:1 Log:0/7 Commit:6
> 3 handling Ready
Ready MustSync=true:
Entries:
1/7 EntryConfChangeV2
Messages:
3->1 MsgAppResp Term:1 Log:0/7 Commit:6
> 4 handling Ready
Ready MustSync=true:
Entries:
1/7 EntryConfChangeV2
Messages:
4->1 MsgAppResp Term:1 Log:0/7 Commit:6
> 1 receiving messages
2->1 MsgAppResp Term:1 Log:0/7 Commit:6
3->1 MsgAppResp Term:1 Log:0/7 Commit:6
4->1 MsgAppResp Term:1 Log:0/7 Commit:6
> 1 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:7 Lead:1 LeadEpoch:1
CommittedEntries:
1/7 EntryConfChangeV2
Messages:
1->2 MsgApp Term:1 Log:1/7 Commit:7
1->3 MsgApp Term:1 Log:1/7 Commit:7
1->4 MsgApp Term:1 Log:1/7 Commit:7
INFO 1 switched to configuration voters=(1 3 4) learners=(2)
> 2 receiving messages
1->2 MsgApp Term:1 Log:1/7 Commit:7
> 3 receiving messages
1->3 MsgApp Term:1 Log:1/7 Commit:7
> 4 receiving messages
1->4 MsgApp Term:1 Log:1/7 Commit:7
> 2 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:7 Lead:1 LeadEpoch:1
CommittedEntries:
1/7 EntryConfChangeV2
Messages:
2->1 MsgAppResp Term:1 Log:0/7 Commit:7
INFO 2 switched to configuration voters=(1 3 4) learners=(2)
> 3 handling Ready
Ready MustSync=true:
HardState Term:1 Vote:1 Commit:7 Lead:1 LeadEpoch:1
CommittedEntries:
1/7 EntryConfChangeV2
Messages:
3->1 MsgAppResp Term:1 Log:0/7 Commit:7
INFO 3 switched to configuration voters=(1 3 4) learners=(2)
> 4 handling Ready
Ready MustSync=true:
HardState Term:1 Commit:7 Lead:1 LeadEpoch:1
CommittedEntries:
1/7 EntryConfChangeV2
Messages:
4->1 MsgAppResp Term:1 Log:0/7 Commit:7
INFO 4 switched to configuration voters=(1 3 4) learners=(2)
> 1 receiving messages
2->1 MsgAppResp Term:1 Log:0/7 Commit:7
3->1 MsgAppResp Term:1 Log:0/7 Commit:7
4->1 MsgAppResp Term:1 Log:0/7 Commit:7