-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
fortificationtracker_test.go
676 lines (629 loc) · 19.2 KB
/
fortificationtracker_test.go
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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
// Copyright 2024 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package tracker
import (
"testing"
"github.com/cockroachdb/cockroach/pkg/raft/quorum"
"github.com/cockroachdb/cockroach/pkg/raft/raftlogger"
pb "github.com/cockroachdb/cockroach/pkg/raft/raftpb"
"github.com/cockroachdb/cockroach/pkg/raft/raftstoreliveness"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/stretchr/testify/require"
)
func TestFortificationEnabled(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
testCases := []struct {
storeLiveness raftstoreliveness.StoreLiveness
expectEnabled bool
}{
{
storeLiveness: raftstoreliveness.Disabled{},
expectEnabled: false,
},
{
storeLiveness: raftstoreliveness.AlwaysLive{},
expectEnabled: true,
},
}
for _, tc := range testCases {
cfg := quorum.MakeEmptyConfig()
fortificationTracker := NewFortificationTracker(&cfg, tc.storeLiveness, raftlogger.DiscardLogger)
require.Equal(t, tc.expectEnabled, fortificationTracker.FortificationEnabled())
}
}
func TestLeadSupportUntil(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ts := func(ts int64) hlc.Timestamp {
return hlc.Timestamp{
WallTime: ts,
}
}
mockLiveness3Peers := makeMockStoreLiveness(
map[pb.PeerID]mockLivenessEntry{
1: makeMockLivenessEntry(10, ts(10)),
2: makeMockLivenessEntry(20, ts(15)),
3: makeMockLivenessEntry(30, ts(20)),
},
)
testCases := []struct {
ids []pb.PeerID
storeLiveness raftstoreliveness.StoreLiveness
setup func(tracker *FortificationTracker)
expTS hlc.Timestamp
}{
{
ids: []pb.PeerID{1, 2, 3},
storeLiveness: mockLiveness3Peers,
setup: func(supportTracker *FortificationTracker) {
// No fortification recorded.
},
expTS: hlc.Timestamp{},
},
{
ids: []pb.PeerID{1, 2, 3},
storeLiveness: mockLiveness3Peers,
setup: func(supportTracker *FortificationTracker) {
supportTracker.RecordFortification(1, 10)
},
expTS: hlc.Timestamp{},
},
{
ids: []pb.PeerID{1, 2, 3},
storeLiveness: mockLiveness3Peers,
setup: func(supportTracker *FortificationTracker) {
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 30)
},
expTS: ts(10),
},
{
ids: []pb.PeerID{1, 2, 3},
storeLiveness: mockLiveness3Peers,
setup: func(supportTracker *FortificationTracker) {
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 30)
supportTracker.RecordFortification(2, 20)
},
expTS: ts(15),
},
{
ids: []pb.PeerID{1, 2, 3},
storeLiveness: mockLiveness3Peers,
setup: func(supportTracker *FortificationTracker) {
// Record fortification at epochs at expired epochs.
supportTracker.RecordFortification(1, 9)
supportTracker.RecordFortification(3, 29)
supportTracker.RecordFortification(2, 19)
},
expTS: hlc.Timestamp{},
},
{
ids: []pb.PeerID{1, 2, 3},
storeLiveness: mockLiveness3Peers,
setup: func(supportTracker *FortificationTracker) {
// Record fortification at newer epochs than what are present in
// StoreLiveness.
//
// NB: This is possible if there is a race between store liveness
// heartbeats updates and fortification responses.
supportTracker.RecordFortification(1, 11)
supportTracker.RecordFortification(3, 31)
supportTracker.RecordFortification(2, 21)
},
expTS: hlc.Timestamp{},
},
{
ids: []pb.PeerID{1, 2, 3},
storeLiveness: mockLiveness3Peers,
setup: func(supportTracker *FortificationTracker) {
// One of the epochs being supported is expired.
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 29) // expired
supportTracker.RecordFortification(2, 20)
},
expTS: ts(10),
},
{
ids: []pb.PeerID{1, 2, 3},
storeLiveness: mockLiveness3Peers,
setup: func(supportTracker *FortificationTracker) {
// Two of the epochs being supported is expired.
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 29) // expired
supportTracker.RecordFortification(2, 19) // expired
},
expTS: hlc.Timestamp{},
},
}
for _, tc := range testCases {
cfg := quorum.MakeEmptyConfig()
for _, id := range tc.ids {
cfg.Voters[0][id] = struct{}{}
}
fortificationTracker := NewFortificationTracker(&cfg, tc.storeLiveness, raftlogger.DiscardLogger)
tc.setup(fortificationTracker)
require.Equal(t, tc.expTS, fortificationTracker.LeadSupportUntil(pb.StateLeader))
}
}
func TestIsFortifiedBy(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ts := func(ts int64) hlc.Timestamp {
return hlc.Timestamp{
WallTime: ts,
}
}
mockLivenessOnePeer := makeMockStoreLiveness(
map[pb.PeerID]mockLivenessEntry{
1: makeMockLivenessEntry(10, ts(20)),
},
)
testCases := []struct {
ids []pb.PeerID
storeLiveness raftstoreliveness.StoreLiveness
setup func(tracker *FortificationTracker)
expSupported bool
expFortified bool
}{
{
ids: []pb.PeerID{1},
// No support recorded at the store liveness fabric.
storeLiveness: makeMockStoreLiveness(map[pb.PeerID]mockLivenessEntry{}),
setup: func(fortificationTracker *FortificationTracker) {
// No support recorded.
},
expSupported: false,
expFortified: false,
},
{
ids: []pb.PeerID{1},
storeLiveness: mockLivenessOnePeer,
setup: func(fortificationTracker *FortificationTracker) {
// No support recorded.
},
expSupported: true,
expFortified: false,
},
{
ids: []pb.PeerID{2},
storeLiveness: mockLivenessOnePeer,
setup: func(fortificationTracker *FortificationTracker) {
// Support recorded for a different follower than the one in
// storeLiveness.
fortificationTracker.RecordFortification(2, 10)
},
expSupported: true,
expFortified: false,
},
{
ids: []pb.PeerID{1},
storeLiveness: mockLivenessOnePeer,
setup: func(fortificationTracker *FortificationTracker) {
// Support recorded for an expired epoch.
fortificationTracker.RecordFortification(1, 9)
},
expSupported: true,
expFortified: false,
},
{
ids: []pb.PeerID{1},
storeLiveness: mockLivenessOnePeer,
setup: func(fortificationTracker *FortificationTracker) {
// Record support at newer epochs than what are present in
// StoreLiveness.
//
// NB: This is possible if there is a race between store liveness
// heartbeats updates and fortification responses.
fortificationTracker.RecordFortification(1, 11)
},
expSupported: true,
expFortified: false,
},
{
ids: []pb.PeerID{1},
storeLiveness: mockLivenessOnePeer,
setup: func(fortificationTracker *FortificationTracker) {
// Record support at the same epoch as the storeLiveness.
fortificationTracker.RecordFortification(1, 10)
},
expSupported: true,
expFortified: true,
},
}
for _, tc := range testCases {
cfg := quorum.MakeEmptyConfig()
for _, id := range tc.ids {
cfg.Voters[0][id] = struct{}{}
}
fortificationTracker := NewFortificationTracker(&cfg, tc.storeLiveness, raftlogger.DiscardLogger)
tc.setup(fortificationTracker)
isFortified, isSupported := fortificationTracker.IsFortifiedBy(1)
require.Equal(t, tc.expSupported, isSupported)
require.Equal(t, tc.expFortified, isFortified)
}
}
// TestQuorumActive ensures that we correctly determine whether a leader's
// quorum is active or not.
func TestQuorumActive(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ts := func(ts int64) hlc.Timestamp {
return hlc.Timestamp{
WallTime: ts,
}
}
mockLiveness := makeMockStoreLiveness(
map[pb.PeerID]mockLivenessEntry{
1: makeMockLivenessEntry(10, ts(10)),
2: makeMockLivenessEntry(20, ts(15)),
3: makeMockLivenessEntry(30, ts(20)),
},
)
testCases := []struct {
setup func(tracker *FortificationTracker)
curTS hlc.Timestamp
expQuorumActive bool
}{
{
setup: func(supportTracker *FortificationTracker) {
// No fortification recorded.
},
curTS: ts(10),
expQuorumActive: false,
},
{
setup: func(supportTracker *FortificationTracker) {
supportTracker.RecordFortification(1, 10)
},
curTS: ts(10),
expQuorumActive: false,
},
{
setup: func(supportTracker *FortificationTracker) {
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 30)
},
curTS: ts(9),
expQuorumActive: true,
},
{
setup: func(supportTracker *FortificationTracker) {
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 30)
},
curTS: ts(14),
expQuorumActive: false,
},
{
setup: func(supportTracker *FortificationTracker) {
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 30)
supportTracker.RecordFortification(2, 20)
},
curTS: ts(14),
expQuorumActive: true,
},
{
setup: func(supportTracker *FortificationTracker) {
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 30)
supportTracker.RecordFortification(2, 20)
},
curTS: ts(16),
expQuorumActive: false,
},
{
setup: func(supportTracker *FortificationTracker) {
// Record fortification at epochs at expired epochs.
supportTracker.RecordFortification(1, 9)
supportTracker.RecordFortification(3, 29)
supportTracker.RecordFortification(2, 19)
},
curTS: ts(10),
expQuorumActive: false,
},
{
setup: func(supportTracker *FortificationTracker) {
// Record fortification at newer epochs than what are present in
// StoreLiveness.
//
// NB: This is possible if there is a race between store liveness
// heartbeats updates and fortification responses.
supportTracker.RecordFortification(1, 11)
supportTracker.RecordFortification(3, 31)
supportTracker.RecordFortification(2, 21)
},
expQuorumActive: false,
},
{
setup: func(supportTracker *FortificationTracker) {
// One of the epochs being supported is expired.
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 29) // expired
supportTracker.RecordFortification(2, 20)
},
curTS: ts(5),
expQuorumActive: true,
},
{
setup: func(supportTracker *FortificationTracker) {
// Two of the epochs being supported is expired.
supportTracker.RecordFortification(1, 10)
supportTracker.RecordFortification(3, 29) // expired
supportTracker.RecordFortification(2, 19) // expired
},
curTS: ts(10),
expQuorumActive: false,
},
}
for i, tc := range testCases {
mockLiveness.curTS = tc.curTS
cfg := quorum.MakeEmptyConfig()
for _, id := range []pb.PeerID{1, 2, 3} {
cfg.Voters[0][id] = struct{}{}
}
fortificationTracker := NewFortificationTracker(&cfg, mockLiveness, raftlogger.DiscardLogger)
tc.setup(fortificationTracker)
require.Equal(t, tc.expQuorumActive, fortificationTracker.QuorumActive(), "#%d %s %s",
i, fortificationTracker.LeadSupportUntil(pb.StateLeader), tc.curTS)
}
}
// TestCanDefortify tests whether a leader can safely de-fortify or not based
// on some tracked state.
func TestCanDefortify(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ts := func(ts int64) hlc.Timestamp {
return hlc.Timestamp{
WallTime: ts,
}
}
mockLiveness := makeMockStoreLiveness(
map[pb.PeerID]mockLivenessEntry{
1: makeMockLivenessEntry(10, ts(10)),
2: makeMockLivenessEntry(20, ts(15)),
3: makeMockLivenessEntry(30, ts(20)),
},
)
testCases := []struct {
setup func(tracker *FortificationTracker)
curTS hlc.Timestamp
expCanDefortify bool
expLeadSupportUntil hlc.Timestamp
}{
{
setup: func(ft *FortificationTracker) {
ft.RecordFortification(1, 10)
ft.RecordFortification(2, 20)
},
curTS: ts(10),
expLeadSupportUntil: ts(10),
expCanDefortify: false,
},
{
setup: func(ft *FortificationTracker) {
ft.RecordFortification(1, 10)
ft.RecordFortification(2, 20)
},
curTS: ts(12),
expLeadSupportUntil: ts(10),
expCanDefortify: true,
},
{
setup: func(ft *FortificationTracker) {
ft.RecordFortification(1, 10)
ft.RecordFortification(2, 20)
ft.RecordFortification(3, 30)
},
curTS: ts(12),
expLeadSupportUntil: ts(15),
expCanDefortify: false,
},
{
setup: func(ft *FortificationTracker) {
ft.RecordFortification(1, 10)
ft.RecordFortification(2, 20)
ft.RecordFortification(3, 30)
},
curTS: ts(18),
expLeadSupportUntil: ts(15),
expCanDefortify: true,
},
{
setup: func(ft *FortificationTracker) {
ft.RecordFortification(1, 10)
ft.RecordFortification(2, 20)
ft.RecordFortification(3, 30)
},
curTS: ts(10),
// LeadSupportUntil = ts(15); however, because we don't call it explicitly,
// we should be able to de-fortify.
expCanDefortify: true,
},
}
for _, tc := range testCases {
mockLiveness.curTS = tc.curTS
cfg := quorum.MakeEmptyConfig()
for _, id := range []pb.PeerID{1, 2, 3} {
cfg.Voters[0][id] = struct{}{}
}
ft := NewFortificationTracker(&cfg, mockLiveness, raftlogger.DiscardLogger)
tc.setup(ft)
if !tc.expLeadSupportUntil.IsEmpty() {
require.Equal(t, tc.expLeadSupportUntil, ft.LeadSupportUntil(pb.StateLeader))
}
require.Equal(t, tc.expCanDefortify, ft.CanDefortify())
}
}
// TestConfigChangeSafe tests whether a leader can safely propose a config
// change.
func TestConfigChangeSafe(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ts := func(ts int64) hlc.Timestamp {
return hlc.Timestamp{
WallTime: ts,
}
}
testCases := []struct {
afterConfigChange func(sl *mockStoreLiveness, tracker *FortificationTracker)
expConfigChangeSafe bool
expLeadSupportUntil hlc.Timestamp
}{
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// Nothing. r4 not providing store liveness support or fortified.
},
expConfigChangeSafe: false,
expLeadSupportUntil: ts(15), // clamped at 15
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 providing store liveness support but not fortified.
sl.liveness[4] = makeMockLivenessEntry(40, ts(5))
},
expConfigChangeSafe: false,
expLeadSupportUntil: ts(15), // clamped at 15
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 fortified at earlier epoch.
sl.liveness[4] = makeMockLivenessEntry(40, ts(5))
ft.RecordFortification(4, 39)
},
expConfigChangeSafe: false,
expLeadSupportUntil: ts(15), // clamped at 15
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 fortified, but support still lagging.
sl.liveness[4] = makeMockLivenessEntry(40, ts(5))
ft.RecordFortification(4, 40)
},
expConfigChangeSafe: false,
expLeadSupportUntil: ts(15), // clamped at 15
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 fortified, but support still lagging.
sl.liveness[4] = makeMockLivenessEntry(40, ts(14))
ft.RecordFortification(4, 40)
},
expConfigChangeSafe: false,
expLeadSupportUntil: ts(15), // clamped at 15
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 fortified, support caught up.
sl.liveness[4] = makeMockLivenessEntry(40, ts(15))
ft.RecordFortification(4, 40)
},
expConfigChangeSafe: true,
expLeadSupportUntil: ts(15),
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 fortified, support caught up.
sl.liveness[4] = makeMockLivenessEntry(40, ts(25))
ft.RecordFortification(4, 40)
},
expConfigChangeSafe: true,
expLeadSupportUntil: ts(15),
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 fortified, support beyond previous config.
sl.liveness[2] = makeMockLivenessEntry(20, ts(25))
sl.liveness[4] = makeMockLivenessEntry(40, ts(25))
ft.RecordFortification(4, 40)
},
expConfigChangeSafe: true,
expLeadSupportUntil: ts(20),
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 not providing store liveness support or fortified. However,
// support from other peers caught up.
sl.liveness[1] = makeMockLivenessEntry(10, ts(15))
},
expConfigChangeSafe: true,
expLeadSupportUntil: ts(15),
},
{
afterConfigChange: func(sl *mockStoreLiveness, ft *FortificationTracker) {
// r4 not providing store liveness support or fortified. However,
// support from other peers beyond previous config.
sl.liveness[1] = makeMockLivenessEntry(10, ts(20))
sl.liveness[2] = makeMockLivenessEntry(20, ts(20))
},
expConfigChangeSafe: true,
expLeadSupportUntil: ts(20),
},
}
for _, tc := range testCases {
mockLiveness := makeMockStoreLiveness(
map[pb.PeerID]mockLivenessEntry{
1: makeMockLivenessEntry(10, ts(10)),
2: makeMockLivenessEntry(20, ts(15)),
3: makeMockLivenessEntry(30, ts(20)),
},
)
cfg := quorum.MakeEmptyConfig()
for _, id := range []pb.PeerID{1, 2, 3} {
cfg.Voters[0][id] = struct{}{}
}
ft := NewFortificationTracker(&cfg, mockLiveness, raftlogger.DiscardLogger)
// Fortify the leader before the configuration change.
ft.RecordFortification(1, 10)
ft.RecordFortification(2, 20)
ft.RecordFortification(3, 30)
require.Equal(t, ts(15), ft.LeadSupportUntil(pb.StateLeader))
// Perform a configuration change that adds r4 to the voter set.
cfg.Voters[0][4] = struct{}{}
tc.afterConfigChange(&mockLiveness, ft)
require.Equal(t, tc.expConfigChangeSafe, ft.ConfigChangeSafe())
require.Equal(t, tc.expLeadSupportUntil, ft.LeadSupportUntil(pb.StateLeader))
}
}
type mockLivenessEntry struct {
epoch pb.Epoch
ts hlc.Timestamp
}
func makeMockLivenessEntry(epoch pb.Epoch, ts hlc.Timestamp) mockLivenessEntry {
return mockLivenessEntry{
epoch: epoch,
ts: ts,
}
}
type mockStoreLiveness struct {
liveness map[pb.PeerID]mockLivenessEntry
curTS hlc.Timestamp
}
func makeMockStoreLiveness(liveness map[pb.PeerID]mockLivenessEntry) mockStoreLiveness {
return mockStoreLiveness{
liveness: liveness,
}
}
// SupportFor implements the raftstoreliveness.StoreLiveness interface.
func (mockStoreLiveness) SupportFor(pb.PeerID) (pb.Epoch, bool) {
panic("unimplemented")
}
// SupportFrom implements the raftstoreliveness.StoreLiveness interface.
func (m mockStoreLiveness) SupportFrom(id pb.PeerID) (pb.Epoch, hlc.Timestamp) {
entry := m.liveness[id]
return entry.epoch, entry.ts
}
// SupportFromEnabled implements the raftstoreliveness.StoreLiveness interface.
func (mockStoreLiveness) SupportFromEnabled() bool {
return true
}
// SupportExpired implements the raftstoreliveness.StoreLiveness interface.
func (m mockStoreLiveness) SupportExpired(ts hlc.Timestamp) bool {
return ts.IsEmpty() || ts.Less(m.curTS)
}