From 9c127c3f91748edbe50b95a34c7da2dacb3b3765 Mon Sep 17 00:00:00 2001 From: tonic Date: Fri, 4 Jun 2021 11:03:35 +0800 Subject: [PATCH] should only revoke when we don't use the lease --- store/etcdv3/meta/etcd.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/store/etcdv3/meta/etcd.go b/store/etcdv3/meta/etcd.go index f9912e396..b86e06992 100644 --- a/store/etcdv3/meta/etcd.go +++ b/store/etcdv3/meta/etcd.go @@ -275,7 +275,6 @@ func (e *ETCD) BindStatus(ctx context.Context, entityKey, statusKey, statusValue // There isn't a status bound to the entity. statusTxn := entityTxn.Responses[0].GetResponseTxn() if !statusTxn.Succeeded { - e.revokeLease(ctx, leaseID) return nil } @@ -287,7 +286,6 @@ func (e *ETCD) BindStatus(ctx context.Context, entityKey, statusKey, statusValue // There is a status bound to the entity yet but its value isn't same as the expected one. valueTxn := statusTxn.Responses[0].GetResponseTxn() if !valueTxn.Succeeded { - e.revokeLease(ctx, leaseID) return nil } @@ -297,6 +295,7 @@ func (e *ETCD) BindStatus(ctx context.Context, entityKey, statusKey, statusValue if origLeaseID != leaseID { e.revokeLease(ctx, leaseID) } + _, err = e.cliv3.KeepAliveOnce(ctx, origLeaseID) return err }