Skip to content

Commit 2af261b

Browse files
committed
testdata: add test for dropping conf change
This commit adds a test which ensures a config change is not proposed if the leader has another yet unapplied config change. Epic: none Release note: none
1 parent 3917e87 commit 2af261b

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This test verifies that a config change is not proposed if the leader has
2+
# unapplied config changes. This ensures a safety requirement stated in
3+
# https://github.com/etcd-io/etcd/issues/7625#issuecomment-489232411
4+
5+
# The check should be performed even if conf change validation is disabled.
6+
add-nodes 1 voters=(1) index=2 disable-conf-change-validation=true
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+
12+
campaign 1
13+
----
14+
INFO 1 is starting a new election at term 0
15+
INFO 1 became candidate at term 1
16+
17+
stabilize log-level=none
18+
----
19+
ok
20+
21+
# Propose one config change. It should be accepted.
22+
propose-conf-change 1 transition=explicit
23+
l2 l3
24+
----
25+
ok
26+
27+
# The first config change gets appended.
28+
process-ready 1
29+
----
30+
Ready MustSync=true:
31+
Entries:
32+
1/4 EntryConfChangeV2 l2 l3
33+
34+
# Propose another config change. It should be rejected, because the first config
35+
# change hasn't applied on the leader yet.
36+
propose-conf-change 1
37+
l4
38+
----
39+
INFO 1 ignoring conf change {ConfChangeTransitionAuto [{ConfChangeAddLearnerNode 4}] []} at config voters=(1): possible unapplied conf change at index 4 (applied to 3)
40+
41+
# The new config change is appended to the log as an empty entry.
42+
stabilize 1
43+
----
44+
> 1 handling Ready
45+
Ready MustSync=true:
46+
HardState Term:1 Vote:1 Commit:4
47+
Entries:
48+
1/5 EntryNormal ""
49+
CommittedEntries:
50+
1/4 EntryConfChangeV2 l2 l3
51+
INFO 1 switched to configuration voters=(1)&&(1) learners=(2 3)
52+
> 1 handling Ready
53+
Ready MustSync=false:
54+
HardState Term:1 Vote:1 Commit:5
55+
CommittedEntries:
56+
1/5 EntryNormal ""
57+
Messages:
58+
1->2 MsgApp Term:1 Log:1/4 Commit:4 Entries:[1/5 EntryNormal ""]
59+
1->3 MsgApp Term:1 Log:1/4 Commit:4 Entries:[1/5 EntryNormal ""]

0 commit comments

Comments
 (0)