Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am working on the initial lease implementation for v3 API.
There is a lot of work needs to be done to make the API work. I do not want to submit a huge pull request. I would like to work on this iteratively for easy review.
The basic idea is to have a Lessor to handle leases including persisting them to disk and removing leased keys when the lease expires from storage. Then we will have a Server to accept client requests, propose requests into raft when consistency is necessary (For example, create a lease or modify a lease needs to be consistent) and apply requests that have gone through raft. Only the leader will handle renew request to reduce the load of raft. When leader changes, all the leases will get automatically renewed.
@yichengq @jonboulle Please give this pr a high level review. I want to iterate fast.