etcdserver: skip updating attr if the member does not exist

This commit is contained in:
Xiang Li
2015-10-08 14:07:16 -07:00
parent 21179d929f
commit 98e30ca7c2
2 changed files with 8 additions and 4 deletions

View File

@ -851,7 +851,10 @@ func (s *EtcdServer) applyRequest(r pb.Request) Response {
if err := json.Unmarshal([]byte(r.Val), &attr); err != nil {
plog.Panicf("unmarshal %s should never fail: %v", r.Val, err)
}
s.cluster.UpdateAttributes(id, attr)
ok := s.cluster.UpdateAttributes(id, attr)
if !ok {
return Response{}
}
}
if r.Path == path.Join(StoreClusterPrefix, "version") {
s.cluster.SetVersion(semver.Must(semver.NewVersion(r.Val)))