mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: allow use of joint quorums
This change introduces joint quorums by changing the Node and RawNode API to accept pb.ConfChangeV2 (on top of pb.ConfChange). pb.ConfChange continues to work as today: it allows carrying out a single configuration change. A pb.ConfChange proposal gets added to the Raft log as such and is thus also observed by the app during Ready handling, and fed back to ApplyConfChange. ConfChangeV2 allows joint configuration changes but will continue to carry out configuration changes in "one phase" (i.e. without ever entering a joint config) when this is possible.
This commit is contained in:
29
raft/confchange/testdata/joint_autoleave.txt
vendored
Normal file
29
raft/confchange/testdata/joint_autoleave.txt
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# Test the autoleave argument to EnterJoint. It defaults to false in the
|
||||
# datadriven tests. The flag has no associated semantics in this package,
|
||||
# it is simply passed through.
|
||||
simple
|
||||
v1
|
||||
----
|
||||
voters=(1)
|
||||
1: StateProbe match=0 next=1
|
||||
|
||||
# Autoleave is reflected in the config.
|
||||
enter-joint autoleave=true
|
||||
v2 v3
|
||||
----
|
||||
voters=(1 2 3)&&(1) autoleave
|
||||
1: StateProbe match=0 next=1
|
||||
2: StateProbe match=0 next=2
|
||||
3: StateProbe match=0 next=2
|
||||
|
||||
# Can't enter-joint twice, even if autoleave changes.
|
||||
enter-joint autoleave=false
|
||||
----
|
||||
config is already joint
|
||||
|
||||
leave-joint
|
||||
----
|
||||
voters=(1 2 3)
|
||||
1: StateProbe match=0 next=1
|
||||
2: StateProbe match=0 next=2
|
||||
3: StateProbe match=0 next=2
|
||||
6
raft/confchange/testdata/simple_safety.txt
vendored
6
raft/confchange/testdata/simple_safety.txt
vendored
@@ -20,7 +20,7 @@ voters=(1 2) learners=(3)
|
||||
simple
|
||||
r1 v5
|
||||
----
|
||||
more than voter changed without entering joint config
|
||||
more than one voter changed without entering joint config
|
||||
|
||||
simple
|
||||
r1 r2
|
||||
@@ -30,12 +30,12 @@ removed all voters
|
||||
simple
|
||||
v3 v4
|
||||
----
|
||||
more than voter changed without entering joint config
|
||||
more than one voter changed without entering joint config
|
||||
|
||||
simple
|
||||
l1 v5
|
||||
----
|
||||
more than voter changed without entering joint config
|
||||
more than one voter changed without entering joint config
|
||||
|
||||
simple
|
||||
l1 l2
|
||||
|
||||
Reference in New Issue
Block a user