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
|
return
|
||||||
}
|
}
|
||||||
// only accept puts; a delete will make observe() spin
|
// only accept puts; a delete will make observe() spin
|
||||||
|
// find the smaller create revision among the puts
|
||||||
for _, ev := range wr.Events {
|
for _, ev := range wr.Events {
|
||||||
if ev.Type == mvccpb.PUT {
|
if ev.Type == mvccpb.PUT {
|
||||||
hdr, kv = &wr.Header, ev.Kv
|
if kv == nil || ev.Kv.CreateRevision < kv.CreateRevision {
|
||||||
// may have multiple revs; hdr.rev = the last rev
|
hdr, kv = &wr.Header, ev.Kv
|
||||||
// set to kv's rev in case batch has multiple Puts
|
// may have multiple revs; hdr.rev = the last rev
|
||||||
hdr.Revision = kv.ModRevision
|
// set to kv's rev in case batch has multiple Puts
|
||||||
break
|
hdr.Revision = kv.ModRevision
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user