Support opaque mode for log_newpages #8582
Open
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
DuckDB pages do not contains page header.
See https://neondb.slack.com/archives/C0799BZALLR/p1722148143356959?thread_ts=1722030414.537519&cid=C0799BZALLR
The problem: we need to wallog huge (256kb) DuckDB pages.
It is natural to use Postgres
log_newpages()
function which insert FPI record.The problem is that this function assumes that pages has Postgres PageHeader.
It is already has
std_page
parameter (wherepd_lower
,pg_upper
specify hole inside page).But even non-standard page is assumed to have PageHeader and Postgres is setting LSN for it.
So there are two other alternatives:
First looks ugly, second requires no changes in Postgres, but a lot of copy&paste of Postgres and Neon code.
Summary of changes
Add
REGBUF_OPAQUE
and pass flags towal_newpages
instead ofstd_page
parameter.Correspondent PR for Postgres:
neondatabase/postgres#456
Checklist before requesting a review
Checklist before merging