Etcd: Is there anyway to update lease in a txn?

Created on 13 Sep 2017  路  6Comments  路  Source: etcd-io/etcd

It looks like there is no lease interface in txn.

arefeature stale

Most helpful comment

How about adding a function func WithRenewLease(leaseID LeaseID) OpOption? Similar to WithIgnoreLease in format.

All 6 comments

@YuleiXiao refresh a lease in a txn? no. What is the use case?

@heyitsanthony
I want to reduce put operation. In some condition, I just need update lease time, no need put again.
txn like this:

if value==A
then
     extend the lease time
else
    OpPut(key, B)

OK, if this feature is going to be supported, it'd be as a flag to Put that would refresh the lease. The Txn interface shouldn't need to change.

How about adding a function func WithRenewLease(leaseID LeaseID) OpOption? Similar to WithIgnoreLease in format.

An option to update lease associated with a key inside a transaction will be welcome. This is a common pattern for LRU eviction.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings