Skip to content
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

kvserver: improved lease protocol #105172

Closed
erikgrinaker opened this issue Jun 20, 2023 · 2 comments
Closed

kvserver: improved lease protocol #105172

erikgrinaker opened this issue Jun 20, 2023 · 2 comments
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv KV Team

Comments

@erikgrinaker
Copy link
Contributor

erikgrinaker commented Jun 20, 2023

This is mostly a placeholder issue, we haven't hashed out a concrete plan yet.

We want the properties of expiration-based leases, but without the cost of a replicated write per range every 3 seconds, and without the cost of ticking/heartbeating Raft ranges. In particular, we want to ensure the lease is functional (can process reads and replicated writes) and that it eagerly acquires leases.

One way to do this is to pull both lease/leader elections and failure detection out of Raft entirely. We would do lease elections at a higher level, with lease votes and expiration possibly stored in memory (mandating waiting out the expiration time on reboot), and instruct Raft who the leader should be (subject to the leader completeness requirement). This would then also take the place of Raft heartbeating and ticking.

See rough internal proposal.

Jira issue: CRDB-28909

Epic CRDB-34218

@erikgrinaker erikgrinaker added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv KV Team labels Jun 20, 2023
@erikgrinaker
Copy link
Contributor Author

If leaseholder election is no longer dependant on a Raft leader, and we mandate lease/leader colocation, then we could also significantly improve (or get rid of, rather) reproposals: #103908 (comment)

@nvanbenschoten
Copy link
Member

Folding into #123847, now that we're getting more clarity on where we want to go.

@nvanbenschoten nvanbenschoten closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv KV Team
Projects
None yet
Development

No branches or pull requests

2 participants