From ec4ca4408fe780fae99b1a9a4caedb8895cabf05 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Thu, 27 Jul 2017 17:24:24 -0700 Subject: [PATCH] etcdserver: support lease txn comparison --- etcdserver/apply.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etcdserver/apply.go b/etcdserver/apply.go index 3aa8d71e6..60ff1092e 100644 --- a/etcdserver/apply.go +++ b/etcdserver/apply.go @@ -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: