etcdserver: check id match

release-2.0
Yicheng Qin 2014-10-03 15:21:10 -07:00
parent d051af4d3d
commit 3859297225
1 changed files with 3 additions and 0 deletions

View File

@ -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)