浏览代码

etcdserver: support lease txn comparison

Anthony Romano 8 年之前
父节点
当前提交
ec4ca4408f
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      etcdserver/apply.go

+ 5 - 0
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: