mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #14538 from nvanbenschoten/nvanbenschoten/broadcastOnLeave
raft: broadcast MsgApp on auto-leave joint config proposal
This commit is contained in:
commit
c102c07081
@ -565,6 +565,7 @@ func (r *raft) advance(rd Ready) {
|
|||||||
if !r.appendEntry(ent) {
|
if !r.appendEntry(ent) {
|
||||||
panic("refused un-refusable auto-leaving ConfChangeV2")
|
panic("refused un-refusable auto-leaving ConfChangeV2")
|
||||||
}
|
}
|
||||||
|
r.bcastAppend()
|
||||||
r.pendingConfIndex = r.raftLog.lastIndex()
|
r.pendingConfIndex = r.raftLog.lastIndex()
|
||||||
r.logger.Infof("initiating automatic transition out of joint configuration %s", r.prs.Config)
|
r.logger.Infof("initiating automatic transition out of joint configuration %s", r.prs.Config)
|
||||||
}
|
}
|
||||||
|
79
raft/testdata/confchange_v2_add_double_auto.txt
vendored
79
raft/testdata/confchange_v2_add_double_auto.txt
vendored
@ -282,6 +282,9 @@ stabilize 1
|
|||||||
Ready MustSync=true:
|
Ready MustSync=true:
|
||||||
Entries:
|
Entries:
|
||||||
1/9 EntryConfChangeV2
|
1/9 EntryConfChangeV2
|
||||||
|
Messages:
|
||||||
|
1->2 MsgApp Term:1 Log:1/8 Commit:6 Entries:[1/9 EntryConfChangeV2]
|
||||||
|
1->3 MsgApp Term:1 Log:1/8 Commit:6 Entries:[1/9 EntryConfChangeV2]
|
||||||
|
|
||||||
# n2 and n3 also switch to the joint config, and ack the transition out of it.
|
# n2 and n3 also switch to the joint config, and ack the transition out of it.
|
||||||
stabilize 2 3
|
stabilize 2 3
|
||||||
@ -290,22 +293,26 @@ stabilize 2 3
|
|||||||
1->2 MsgApp Term:1 Log:1/6 Commit:5 Entries:[1/7 EntryNormal "foo"]
|
1->2 MsgApp Term:1 Log:1/6 Commit:5 Entries:[1/7 EntryNormal "foo"]
|
||||||
1->2 MsgApp Term:1 Log:1/7 Commit:5 Entries:[1/8 EntryNormal "bar"]
|
1->2 MsgApp Term:1 Log:1/7 Commit:5 Entries:[1/8 EntryNormal "bar"]
|
||||||
1->2 MsgApp Term:1 Log:1/8 Commit:6
|
1->2 MsgApp Term:1 Log:1/8 Commit:6
|
||||||
|
1->2 MsgApp Term:1 Log:1/8 Commit:6 Entries:[1/9 EntryConfChangeV2]
|
||||||
> 3 receiving messages
|
> 3 receiving messages
|
||||||
1->3 MsgApp Term:1 Log:1/6 Commit:5 Entries:[1/7 EntryNormal "foo"]
|
1->3 MsgApp Term:1 Log:1/6 Commit:5 Entries:[1/7 EntryNormal "foo"]
|
||||||
1->3 MsgApp Term:1 Log:1/7 Commit:5 Entries:[1/8 EntryNormal "bar"]
|
1->3 MsgApp Term:1 Log:1/7 Commit:5 Entries:[1/8 EntryNormal "bar"]
|
||||||
1->3 MsgApp Term:1 Log:1/8 Commit:6
|
1->3 MsgApp Term:1 Log:1/8 Commit:6
|
||||||
|
1->3 MsgApp Term:1 Log:1/8 Commit:6 Entries:[1/9 EntryConfChangeV2]
|
||||||
> 2 handling Ready
|
> 2 handling Ready
|
||||||
Ready MustSync=true:
|
Ready MustSync=true:
|
||||||
HardState Term:1 Commit:6
|
HardState Term:1 Commit:6
|
||||||
Entries:
|
Entries:
|
||||||
1/7 EntryNormal "foo"
|
1/7 EntryNormal "foo"
|
||||||
1/8 EntryNormal "bar"
|
1/8 EntryNormal "bar"
|
||||||
|
1/9 EntryConfChangeV2
|
||||||
CommittedEntries:
|
CommittedEntries:
|
||||||
1/6 EntryConfChangeV2 r2 r3
|
1/6 EntryConfChangeV2 r2 r3
|
||||||
Messages:
|
Messages:
|
||||||
2->1 MsgAppResp Term:1 Log:0/7
|
2->1 MsgAppResp Term:1 Log:0/7
|
||||||
2->1 MsgAppResp Term:1 Log:0/8
|
2->1 MsgAppResp Term:1 Log:0/8
|
||||||
2->1 MsgAppResp Term:1 Log:0/8
|
2->1 MsgAppResp Term:1 Log:0/8
|
||||||
|
2->1 MsgAppResp Term:1 Log:0/9
|
||||||
INFO 2 switched to configuration voters=(1)&&(1 2 3) autoleave
|
INFO 2 switched to configuration voters=(1)&&(1 2 3) autoleave
|
||||||
> 3 handling Ready
|
> 3 handling Ready
|
||||||
Ready MustSync=true:
|
Ready MustSync=true:
|
||||||
@ -313,12 +320,14 @@ stabilize 2 3
|
|||||||
Entries:
|
Entries:
|
||||||
1/7 EntryNormal "foo"
|
1/7 EntryNormal "foo"
|
||||||
1/8 EntryNormal "bar"
|
1/8 EntryNormal "bar"
|
||||||
|
1/9 EntryConfChangeV2
|
||||||
CommittedEntries:
|
CommittedEntries:
|
||||||
1/6 EntryConfChangeV2 r2 r3
|
1/6 EntryConfChangeV2 r2 r3
|
||||||
Messages:
|
Messages:
|
||||||
3->1 MsgAppResp Term:1 Log:0/7
|
3->1 MsgAppResp Term:1 Log:0/7
|
||||||
3->1 MsgAppResp Term:1 Log:0/8
|
3->1 MsgAppResp Term:1 Log:0/8
|
||||||
3->1 MsgAppResp Term:1 Log:0/8
|
3->1 MsgAppResp Term:1 Log:0/8
|
||||||
|
3->1 MsgAppResp Term:1 Log:0/9
|
||||||
INFO 3 switched to configuration voters=(1)&&(1 2 3) autoleave
|
INFO 3 switched to configuration voters=(1)&&(1 2 3) autoleave
|
||||||
|
|
||||||
# n2 and n3 also leave the joint config and the dust settles. We see at the very
|
# n2 and n3 also leave the joint config and the dust settles. We see at the very
|
||||||
@ -330,84 +339,68 @@ stabilize
|
|||||||
2->1 MsgAppResp Term:1 Log:0/7
|
2->1 MsgAppResp Term:1 Log:0/7
|
||||||
2->1 MsgAppResp Term:1 Log:0/8
|
2->1 MsgAppResp Term:1 Log:0/8
|
||||||
2->1 MsgAppResp Term:1 Log:0/8
|
2->1 MsgAppResp Term:1 Log:0/8
|
||||||
|
2->1 MsgAppResp Term:1 Log:0/9
|
||||||
3->1 MsgAppResp Term:1 Log:0/7
|
3->1 MsgAppResp Term:1 Log:0/7
|
||||||
3->1 MsgAppResp Term:1 Log:0/8
|
3->1 MsgAppResp Term:1 Log:0/8
|
||||||
3->1 MsgAppResp Term:1 Log:0/8
|
3->1 MsgAppResp Term:1 Log:0/8
|
||||||
> 1 handling Ready
|
|
||||||
Ready MustSync=false:
|
|
||||||
HardState Term:1 Vote:1 Commit:8
|
|
||||||
CommittedEntries:
|
|
||||||
1/7 EntryNormal "foo"
|
|
||||||
1/8 EntryNormal "bar"
|
|
||||||
Messages:
|
|
||||||
1->2 MsgApp Term:1 Log:1/8 Commit:7 Entries:[1/9 EntryConfChangeV2]
|
|
||||||
1->3 MsgApp Term:1 Log:1/8 Commit:7 Entries:[1/9 EntryConfChangeV2]
|
|
||||||
1->2 MsgApp Term:1 Log:1/9 Commit:8
|
|
||||||
1->3 MsgApp Term:1 Log:1/9 Commit:8
|
|
||||||
> 2 receiving messages
|
|
||||||
1->2 MsgApp Term:1 Log:1/8 Commit:7 Entries:[1/9 EntryConfChangeV2]
|
|
||||||
1->2 MsgApp Term:1 Log:1/9 Commit:8
|
|
||||||
> 3 receiving messages
|
|
||||||
1->3 MsgApp Term:1 Log:1/8 Commit:7 Entries:[1/9 EntryConfChangeV2]
|
|
||||||
1->3 MsgApp Term:1 Log:1/9 Commit:8
|
|
||||||
> 2 handling Ready
|
|
||||||
Ready MustSync=true:
|
|
||||||
HardState Term:1 Commit:8
|
|
||||||
Entries:
|
|
||||||
1/9 EntryConfChangeV2
|
|
||||||
CommittedEntries:
|
|
||||||
1/7 EntryNormal "foo"
|
|
||||||
1/8 EntryNormal "bar"
|
|
||||||
Messages:
|
|
||||||
2->1 MsgAppResp Term:1 Log:0/9
|
|
||||||
2->1 MsgAppResp Term:1 Log:0/9
|
|
||||||
> 3 handling Ready
|
|
||||||
Ready MustSync=true:
|
|
||||||
HardState Term:1 Commit:8
|
|
||||||
Entries:
|
|
||||||
1/9 EntryConfChangeV2
|
|
||||||
CommittedEntries:
|
|
||||||
1/7 EntryNormal "foo"
|
|
||||||
1/8 EntryNormal "bar"
|
|
||||||
Messages:
|
|
||||||
3->1 MsgAppResp Term:1 Log:0/9
|
|
||||||
3->1 MsgAppResp Term:1 Log:0/9
|
|
||||||
> 1 receiving messages
|
|
||||||
2->1 MsgAppResp Term:1 Log:0/9
|
|
||||||
2->1 MsgAppResp Term:1 Log:0/9
|
|
||||||
3->1 MsgAppResp Term:1 Log:0/9
|
|
||||||
3->1 MsgAppResp Term:1 Log:0/9
|
3->1 MsgAppResp Term:1 Log:0/9
|
||||||
> 1 handling Ready
|
> 1 handling Ready
|
||||||
Ready MustSync=false:
|
Ready MustSync=false:
|
||||||
HardState Term:1 Vote:1 Commit:9
|
HardState Term:1 Vote:1 Commit:9
|
||||||
CommittedEntries:
|
CommittedEntries:
|
||||||
|
1/7 EntryNormal "foo"
|
||||||
|
1/8 EntryNormal "bar"
|
||||||
1/9 EntryConfChangeV2
|
1/9 EntryConfChangeV2
|
||||||
Messages:
|
Messages:
|
||||||
|
1->2 MsgApp Term:1 Log:1/9 Commit:7
|
||||||
|
1->3 MsgApp Term:1 Log:1/9 Commit:7
|
||||||
|
1->2 MsgApp Term:1 Log:1/9 Commit:8
|
||||||
|
1->3 MsgApp Term:1 Log:1/9 Commit:8
|
||||||
1->2 MsgApp Term:1 Log:1/9 Commit:9
|
1->2 MsgApp Term:1 Log:1/9 Commit:9
|
||||||
1->3 MsgApp Term:1 Log:1/9 Commit:9
|
1->3 MsgApp Term:1 Log:1/9 Commit:9
|
||||||
INFO 1 switched to configuration voters=(1)
|
INFO 1 switched to configuration voters=(1)
|
||||||
> 2 receiving messages
|
> 2 receiving messages
|
||||||
|
1->2 MsgApp Term:1 Log:1/9 Commit:7
|
||||||
|
1->2 MsgApp Term:1 Log:1/9 Commit:8
|
||||||
1->2 MsgApp Term:1 Log:1/9 Commit:9
|
1->2 MsgApp Term:1 Log:1/9 Commit:9
|
||||||
> 3 receiving messages
|
> 3 receiving messages
|
||||||
|
1->3 MsgApp Term:1 Log:1/9 Commit:7
|
||||||
|
1->3 MsgApp Term:1 Log:1/9 Commit:8
|
||||||
1->3 MsgApp Term:1 Log:1/9 Commit:9
|
1->3 MsgApp Term:1 Log:1/9 Commit:9
|
||||||
> 2 handling Ready
|
> 2 handling Ready
|
||||||
Ready MustSync=false:
|
Ready MustSync=false:
|
||||||
HardState Term:1 Commit:9
|
HardState Term:1 Commit:9
|
||||||
CommittedEntries:
|
CommittedEntries:
|
||||||
|
1/7 EntryNormal "foo"
|
||||||
|
1/8 EntryNormal "bar"
|
||||||
1/9 EntryConfChangeV2
|
1/9 EntryConfChangeV2
|
||||||
Messages:
|
Messages:
|
||||||
2->1 MsgAppResp Term:1 Log:0/9
|
2->1 MsgAppResp Term:1 Log:0/9
|
||||||
|
2->1 MsgAppResp Term:1 Log:0/9
|
||||||
|
2->1 MsgAppResp Term:1 Log:0/9
|
||||||
INFO 2 switched to configuration voters=(1)
|
INFO 2 switched to configuration voters=(1)
|
||||||
> 3 handling Ready
|
> 3 handling Ready
|
||||||
Ready MustSync=false:
|
Ready MustSync=false:
|
||||||
HardState Term:1 Commit:9
|
HardState Term:1 Commit:9
|
||||||
CommittedEntries:
|
CommittedEntries:
|
||||||
|
1/7 EntryNormal "foo"
|
||||||
|
1/8 EntryNormal "bar"
|
||||||
1/9 EntryConfChangeV2
|
1/9 EntryConfChangeV2
|
||||||
Messages:
|
Messages:
|
||||||
3->1 MsgAppResp Term:1 Log:0/9
|
3->1 MsgAppResp Term:1 Log:0/9
|
||||||
|
3->1 MsgAppResp Term:1 Log:0/9
|
||||||
|
3->1 MsgAppResp Term:1 Log:0/9
|
||||||
INFO 3 switched to configuration voters=(1)
|
INFO 3 switched to configuration voters=(1)
|
||||||
> 1 receiving messages
|
> 1 receiving messages
|
||||||
|
2->1 MsgAppResp Term:1 Log:0/9
|
||||||
|
raft: cannot step as peer not found
|
||||||
|
2->1 MsgAppResp Term:1 Log:0/9
|
||||||
|
raft: cannot step as peer not found
|
||||||
2->1 MsgAppResp Term:1 Log:0/9
|
2->1 MsgAppResp Term:1 Log:0/9
|
||||||
raft: cannot step as peer not found
|
raft: cannot step as peer not found
|
||||||
3->1 MsgAppResp Term:1 Log:0/9
|
3->1 MsgAppResp Term:1 Log:0/9
|
||||||
raft: cannot step as peer not found
|
raft: cannot step as peer not found
|
||||||
|
3->1 MsgAppResp Term:1 Log:0/9
|
||||||
|
raft: cannot step as peer not found
|
||||||
|
3->1 MsgAppResp Term:1 Log:0/9
|
||||||
|
raft: cannot step as peer not found
|
||||||
|
Loading…
x
Reference in New Issue
Block a user