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

feat(pageserver): initial code sketch & test case for combined gc+compaction at gc_horizon #7948

Merged
merged 5 commits into from
Jun 11, 2024

Conversation

skyzh
Copy link
Member

@skyzh skyzh commented Jun 3, 2024

Problem

A demo for a building block for compaction. The GC-compaction operation iterates all layers below/intersect with the GC horizon, and do a full layer rewrite of all of them. The end result will be image layer covering the full keyspace at GC-horizon, and a bunch of delta layers above the GC-horizon. This helps us collect the garbages of the test_gc_feedback test case to reduce space amplification.

This operation can be manually triggered using an HTTP API or be triggered based on some metrics. Actual method TBD.

The test is very basic and it's very likely that most part of the algorithm will be rewritten. I would like to get this merged so that I can have a basic skeleton for the algorithm and then make incremental changes.

image

Summary of changes

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

Copy link

github-actions bot commented Jun 3, 2024

3198 tests run: 3056 passed, 0 failed, 142 skipped (full report)


Flaky tests (1)

Postgres 14

  • test_pageserver_restarts_under_worload: release

Code coverage* (full report)

  • functions: 31.6% (6633 of 20979 functions)
  • lines: 48.6% (51461 of 105800 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
90edb45 at 2024-06-11T14:23:48.082Z :recycle:

@skyzh skyzh changed the title [WIP/DNM] feat(pageserver): collect garbages while bottom-most level compaction feat(pageserver): collect garbages while bottom-most level compaction Jun 6, 2024
@skyzh skyzh requested a review from problame June 6, 2024 18:32
@skyzh skyzh marked this pull request as ready for review June 6, 2024 18:32
@skyzh skyzh requested a review from a team as a code owner June 6, 2024 18:32
Copy link
Contributor

@problame problame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        // TODO: we should test a real delta record here, which requires us to add a variant of NeonWalRecord for testing purpose.

At the Istanbul offsite, Vlad proposed to add such a record type (guarded by #[cfg(test)].).

I think your next PR should be that.
Extend test_simple_bottom_most_compaction so we exercise the redo code path.

pageserver/src/tenant/storage_layer/layer.rs Outdated Show resolved Hide resolved
pageserver/src/tenant/timeline/compaction.rs Outdated Show resolved Hide resolved
pageserver/src/tenant/timeline/layer_manager.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@problame problame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More appropriate PR title (I don't think we should talk about levels, really):

initial code sketch & test case for combined gc+compaction at gc_horizon

@skyzh skyzh changed the title feat(pageserver): collect garbages while bottom-most level compaction feat(pageserver): initial code sketch & test case for combined gc+compaction at gc_horizon Jun 10, 2024
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>
@skyzh skyzh enabled auto-merge (squash) June 11, 2024 14:03
@skyzh skyzh merged commit 4c21007 into main Jun 11, 2024
59 of 60 checks passed
@skyzh skyzh deleted the skyzh/compaction-gc branch June 11, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants