Browse Source

etcdserver: check id match

Yicheng Qin 11 years ago
parent
commit
3859297225
1 changed files with 3 additions and 0 deletions
  1. 3 0
      etcdserver/server.go

+ 3 - 0
etcdserver/server.go

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