-
Notifications
You must be signed in to change notification settings - Fork 458
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
safekeeper: use protobuf for sending compressed records to pageserver #9821
Merged
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
6941 tests run: 6633 passed, 0 failed, 308 skipped (full report)Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
caf475c at 2024-11-27T11:51:36.353Z :recycle: |
VladLazar
force-pushed
the
vlad/sk-ps-protobuf
branch
2 times, most recently
from
November 20, 2024 15:37
a6413a3
to
8b13a09
Compare
We want to add new wire formats, but the current code has bincode hard-codeded. To this end: 1. Rework the wal_receiver_protocol PS config to include a format modifier for interpreted protocol type. 2. Abstract wire format encoding and decoding to a separate module in wal_decoder 3. Glue things back together
Instead of serializing a vector of records over the wire, define a type for it. Also include next_record_lsn into that type to get varint encoding.
The bulk of this commit is glue code to convert between protobuf representation and in-memory representation.
With this patch we can serialize one batch while waiting for the read for the next one.
VladLazar
force-pushed
the
vlad/sk-ps-protobuf
branch
from
November 25, 2024 17:46
8b13a09
to
b2ff120
Compare
VladLazar
force-pushed
the
vlad/sk-ps-protobuf
branch
from
November 25, 2024 17:49
b2ff120
to
884803a
Compare
erikgrinaker
approved these changes
Nov 25, 2024
test_sharded_ingest[release-pg16-vanilla-1].wal_ingest: 124.027 s test_sharded_ingest[release-pg16-vanilla-1].pageserver_ingest: 124.038 s test_sharded_ingest[release-pg16-vanilla-1].wal_written: 6,911 MB test_sharded_ingest[release-pg16-vanilla-1].wal_ingested: 6,911 MB test_sharded_ingest[release-pg16-vanilla-1].records_received: 100442685 records test_sharded_ingest[release-pg16-vanilla-8].wal_ingest: 121.476 s test_sharded_ingest[release-pg16-vanilla-8].pageserver_ingest: 121.493 s test_sharded_ingest[release-pg16-vanilla-8].wal_written: 6,911 MB test_sharded_ingest[release-pg16-vanilla-8].wal_ingested: 55,284 MB test_sharded_ingest[release-pg16-vanilla-8].records_received: 803541480 records test_sharded_ingest[release-pg16-vanilla-32].wal_ingest: 145.895 s test_sharded_ingest[release-pg16-vanilla-32].pageserver_ingest: 145.938 s test_sharded_ingest[release-pg16-vanilla-32].wal_written: 6,911 MB test_sharded_ingest[release-pg16-vanilla-32].wal_ingested: 221,137 MB test_sharded_ingest[release-pg16-vanilla-32].records_received: 3214165952 records test_sharded_ingest[release-pg16-interpreted-bincode-compressed-1].wal_ingest: 121.892 s test_sharded_ingest[release-pg16-interpreted-bincode-compressed-1].pageserver_ingest: 121.903 s test_sharded_ingest[release-pg16-interpreted-bincode-compressed-1].wal_written: 6,911 MB test_sharded_ingest[release-pg16-interpreted-bincode-compressed-1].wal_ingested: 1,557 MB test_sharded_ingest[release-pg16-interpreted-bincode-compressed-1].records_received: 100442669 records test_sharded_ingest[release-pg16-interpreted-bincode-compressed-8].wal_ingest: 123.056 s test_sharded_ingest[release-pg16-interpreted-bincode-compressed-8].pageserver_ingest: 123.073 s test_sharded_ingest[release-pg16-interpreted-bincode-compressed-8].wal_written: 6,911 MB test_sharded_ingest[release-pg16-interpreted-bincode-compressed-8].wal_ingested: 2,037 MB test_sharded_ingest[release-pg16-interpreted-bincode-compressed-8].records_received: 188730015 records test_sharded_ingest[release-pg16-interpreted-bincode-compressed-32].wal_ingest: 142.646 s test_sharded_ingest[release-pg16-interpreted-bincode-compressed-32].pageserver_ingest: 142.687 s test_sharded_ingest[release-pg16-interpreted-bincode-compressed-32].wal_written: 6,911 MB test_sharded_ingest[release-pg16-interpreted-bincode-compressed-32].wal_ingested: 2,256 MB test_sharded_ingest[release-pg16-interpreted-bincode-compressed-32].records_received: 214164479 records test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-1].wal_ingest: 122.775 s test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-1].pageserver_ingest: 122.787 s test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-1].wal_written: 6,911 MB test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-1].wal_ingested: 1,540 MB test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-1].records_received: 100442669 records test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-8].wal_ingest: 121.436 s test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-8].pageserver_ingest: 121.453 s test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-8].wal_written: 6,911 MB test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-8].wal_ingested: 1,870 MB test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-8].records_received: 188730015 records test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-32].wal_ingest: 143.335 s test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-32].pageserver_ingest: 143.380 s test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-32].wal_written: 6,911 MB test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-32].wal_ingested: 2,073 MB test_sharded_ingest[release-pg16-interpreted-protobuf-compressed-32].records_received: 214164479 records
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
#9746 lifted decoding and interpretation of WAL to the safekeeper.
This reduced the ingested amount on the pageservers by around 10x for a tenant with 8 shards, but doubled
the ingested amount for single sharded tenants.
Also, #9746 uses bincode which doesn't support schema evolution.
Technically the schema can be evolved, but it's very cumbersome.
Summary of changes
This patch set addresses both problems by adding protobuf support for the interpreted wal records and adding compression support. Compressed protobuf reduced the ingested amount by 100x on the 32 shards
test_sharded_ingest
case (compared to non-interpreted proto). For the 1 shard case the reduction is 5x.Sister change to
rust-postgres
is here.Links
Related: #9336
Epic: #9329