-
Notifications
You must be signed in to change notification settings - Fork 456
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
feat(pageserver): gc-compaction split over LSN #9900
Conversation
7716 tests run: 7397 passed, 0 failed, 319 skipped (full report)Flaky tests (7)Postgres 17
Postgres 16
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
adc8d2a at 2024-12-11T20:10:37.944Z :recycle: |
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.
It would make sense to express CompactOptions
compact_below_lsn
and compact_above_lsn
as an unbounded range, instead of as two options.
Maybe fold them into CompactRange
, so that CompactRange
can represent the entire rectangle.
Please do that in a future PR though.
It would be nice to add a test that tests the interaction of key & lsn range limits, i.e., a test that tests behavior of specifying a full rectangle.
Maybe just copy-paste and adjust the test you added in this PR.
Definition of compact_above_lsn
.
Above is kinda ambiguous wrt inclusivity vs exclusivity.
2077ba4
to
15f26fe
Compare
4b01a48
to
233eebb
Compare
Included in 233eebb, where I did some refactors to make the compaction job desc more clear.
part of 20b6336
Comments are added in 233eebb. But actually, whether it's exclusive/inclusive doesn't actually matter because the compaction picker will not treat this input range as a definitive input -- it will change the lsn range based on the layer selection to avoid cut a layer in half. |
Signed-off-by: Alex Chi Z <chi@neon.tech>
Co-authored-by: Christian Schwarz <christian@neon.tech>
Signed-off-by: Alex Chi Z <chi@neon.tech>
Signed-off-by: Alex Chi Z <chi@neon.tech>
Signed-off-by: Alex Chi Z <chi@neon.tech>
Signed-off-by: Alex Chi Z <chi@neon.tech>
98923e5
to
0ebfb1e
Compare
Signed-off-by: Alex Chi Z <chi@neon.tech>
eb4c6c7
to
3966318
Compare
Signed-off-by: Alex Chi Z <chi@neon.tech>
72b1bf1
to
6fa8592
Compare
Signed-off-by: Alex Chi Z <chi@neon.tech>
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.
I think we need to track 4 rewritten layers now
- above rectangle
- below rectangle
- left of rectangle
- right of rectangle
neon/pageserver/src/tenant/timeline/compaction.rs
Line 2308 in 19809e9
desc.lsn_range.clone(), |
Should have a test case for this before fixing.
I think the scenario is
- base image layer
- a 4-key-wide-4 lsn-tall delta layer on top
- a 2-key-wide-2-lsn-tall compact_{key,lsn}_range
The selection algorithm will not select an LSN that intersects with the layer, so we never need to rewrite those layers (and that's why they didn't get tracked) |
Signed-off-by: Alex Chi Z <chi@neon.tech>
Looking at the current code, the delta layer lsn range is generated as expected.
Here lowest_retain_lsn = min_layer_lsn, and end_lsn = max_lsn. So the generated delta layer is actually min_layer_lsn..max_layer_lsn. This means that all current tests that checks layer key will ensure delta layers are created using the correct lsn range. We can merge the patch for now. |
Problem
part of #9114, stacked PR over #9897, partially refactored to help with #10031
Summary of changes
above_lsn
parameter. We only compact the layers above this LSN, and all data below the LSN are treated as if they are on the ancestor branch.GcCompactJob
that describes the rectangular range to be compacted.