-
Notifications
You must be signed in to change notification settings - Fork 354
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: support changing IndexPart::metadata_bytes to json in future release #7693
Open
koivunej
wants to merge
7
commits into
main
Choose a base branch
from
joonas/legacy_metadata_as_json_in_future
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 tasks
koivunej
force-pushed
the
joonas/legacy_metadata_as_json_in_future
branch
from
May 10, 2024 11:44
4e1d86f
to
63e3425
Compare
koivunej
changed the title
fix: support changing IndexPart::metadata_bytes to
fix: support changing IndexPart::metadata_bytes to json in future release
May 10, 2024
::legacy_metadata
in future release
koivunej
changed the title
fix: support changing IndexPart::metadata_bytes to json in future release
feat: support changing IndexPart::metadata_bytes to json in future release
May 10, 2024
3024 tests run: 2891 passed, 0 failed, 133 skipped (full report)Flaky tests (2)Postgres 16
Postgres 14
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
6970bde at 2024-05-10T12:44:43.316Z :recycle: |
skyzh
approved these changes
May 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently we serialize the
TimelineMetadata
into bytes to put it intoindex_part.json
. ThisVec<u8>
(hopefully[u8; 512]
) representation was chosen because of problems serializing TimelineId and Lsn between different serializers (bincode, json). After #5335, the serialization of those types became serialization format aware or format agnostic.We've removed the pageserver local
metadata
file writing in #6769.Summary of changes
Allow switching from the current serialization format to plain JSON for the legacy TimelineMetadata format in the future by adding a competitive serialization method to the current one (
crate::tenant::metadata::modern_serde
), which accepts both old bytes and new plain JSON.The benefits of this are that dumping the index_part.json with pretty printing no longer produces more than 500 lines of output, but after enabling it produces lines only proportional to the layer count, like:
This is an alternative to #7663, which still uses the
Vec<u8>
idea, but this time with mixed bincode+json instead of just bincode.In the future, I propose we completely stop using this legacy metadata type and wasting time trying to come up with another version numbering scheme in addition to the informative-only one already found in
index_part.json
, and go ahead with storing metadata or feature flags on theindex_part.json
itself.Open questions: