mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: check id match
This commit is contained in:
parent
d051af4d3d
commit
3859297225
@ -530,6 +530,9 @@ func (s *EtcdServer) applyConfChange(cc raftpb.ConfChange) {
|
||||
if err := json.Unmarshal(cc.Context, &m); err != nil {
|
||||
panic("unexpected unmarshal error")
|
||||
}
|
||||
if cc.NodeID != m.ID {
|
||||
panic("unmatch node id")
|
||||
}
|
||||
s.ClusterStore.Create(m)
|
||||
case raftpb.ConfChangeRemoveNode:
|
||||
s.ClusterStore.Delete(cc.NodeID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user