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

fix(pageserver): ensure initial image layers have correct key ranges #10374

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

skyzh
Copy link
Member

@skyzh skyzh commented Jan 13, 2025

Problem

Discovered during the relation dir refactor work.

If we do not create images as in this patch, we would get two set of image layers:

0000...METADATA_KEYS
0000...REL_KEYS

They overlap at the same LSN and would cause data loss for relation keys. This doesn't happen in prod because initial image layer generation is never called, but better to be fixed to avoid future issues with the reldir refactors.

Summary of changes

  • Consolidate create_image_layers call into a single one.

@skyzh skyzh requested a review from a team as a code owner January 13, 2025 18:11
@skyzh skyzh requested review from problame and arpad-m January 13, 2025 18:11
Signed-off-by: Alex Chi Z <chi@neon.tech>
@skyzh skyzh force-pushed the skyzh/initial-image-create-fix branch from 9ec19bd to 877671e Compare January 13, 2025 18:21
Copy link

7304 tests run: 6934 passed, 0 failed, 370 skipped (full report)


Code coverage* (full report)

  • functions: 32.7% (8056 of 24666 functions)
  • lines: 47.8% (67022 of 140341 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
877671e at 2025-01-13T20:26:43.255Z :recycle:

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.

LGTM.

Should we should just remove the initdb_lsn => image layer optimization if it's dead at runtime?

@skyzh
Copy link
Member Author

skyzh commented Jan 14, 2025

Should we should just remove the initdb_lsn => image layer optimization if it's dead at runtime?

I think it still makes some sense so let's keep it until the code is unmaintainable.

@skyzh skyzh added this pull request to the merge queue Jan 14, 2025
Merged via the queue into main with commit 9bdb14c Jan 14, 2025
84 checks passed
@skyzh skyzh deleted the skyzh/initial-image-create-fix branch January 14, 2025 15:28
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.

3 participants