etcdserver: support lease txn comparison

This commit is contained in:
Anthony Romano 2017-07-27 17:24:24 -07:00
parent 71e56a44b7
commit ec4ca4408f

View File

@ -473,6 +473,11 @@ func compareKV(c *pb.Compare, ckv mvccpb.KeyValue) bool {
rev = tv.Version
}
result = compareInt64(ckv.Version, rev)
case pb.Compare_LEASE:
if tv, _ := c.TargetUnion.(*pb.Compare_Lease); tv != nil {
rev = tv.Lease
}
result = compareInt64(ckv.Lease, rev)
}
switch c.Result {
case pb.Compare_EQUAL: