mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge 4518b4874e1d18cf68e86b517629c40c50ad75e4 into c86c93ca2951338115159dcdd20711603044e1f1
This commit is contained in:
commit
6089460224
@ -195,13 +195,15 @@ func (e *Election) observe(ctx context.Context, ch chan<- v3.GetResponse) {
|
||||
return
|
||||
}
|
||||
// only accept puts; a delete will make observe() spin
|
||||
// find the smaller create revision among the puts
|
||||
for _, ev := range wr.Events {
|
||||
if ev.Type == mvccpb.PUT {
|
||||
if kv == nil || ev.Kv.CreateRevision < kv.CreateRevision {
|
||||
hdr, kv = &wr.Header, ev.Kv
|
||||
// may have multiple revs; hdr.rev = the last rev
|
||||
// set to kv's rev in case batch has multiple Puts
|
||||
hdr.Revision = kv.ModRevision
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user