neon
neon copied to clipboard
feat(pageserver): integrate lsn lease into synthetic size
Part of #7497, closes #8071. (accidentally closed #8208, reopened here)
Problem
After the changes in #8084, we need synthetic size to also account for leased LSNs so that users do not get free retention by running a small ephemeral endpoint for a long time.
Summary of changes
This PR integrates LSN leases into the synthetic size calculation. We model leases as read-only branches started at the leased LSN (except it does not have a timeline id).
Other changes:
- Add new unit tests testing whether a lease behaves like a read-only branch.
- Change
/size_debug
response to include lease point in the SVG visualization. - Fix
/lsn_lease
HTTP API to do proper parsing for POST.
Checklist before requesting a review
- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
- [ ] If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.
Checklist before merging
- [ ] Do not forget to reformat commit message to not include the above checklist