-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: lease comparison target #8324
Conversation
// range_end compares the given target to all keys in the range [key, range_end). | ||
// See RangeRequest for more details on key ranges. | ||
bytes range_end = 8; | ||
bytes range_end = 64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this field is not in any release yet, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, caught it early
do we also need to update etcdctl? |
067cc5a
to
68934a9
Compare
OK added etcdctl support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
lgtm |
Also shifts down fields following target_union in case there's any more reason to expand. OK since range_end is still pre-release.
68934a9
to
341664f
Compare
It's useful to perform some atomic actions based on leases. For disconnected linearized reads, keys with ttls can't be easily leased since if the client is disconnected it doesn't know whether the ttl expires. Although there could be a Get in the leasing txn to later undo the leasing if the key turns out to have a ttl, this is inefficient and less reliable than gating it at the txn level.
I've omitted clientv3 support for the time being since calling the comparison function Lease to follow the current convention would conflict with the lease interface