Skip to content

Commit

Permalink
should only revoke when we don't use the lease
Browse files Browse the repository at this point in the history
  • Loading branch information
tonicmuroq committed Jun 4, 2021
1 parent bc4260d commit 9c127c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions store/etcdv3/meta/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand All @@ -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
}
Expand Down

0 comments on commit 9c127c3

Please sign in to comment.