Skip to content

fix: fpw when split non-root page#169

Open
buriedpot wants to merge 1 commit intopostgrespro:masterfrom
buriedpot:fix/forget_non_root_page_split_fpw
Open

fix: fpw when split non-root page#169
buriedpot wants to merge 1 commit intopostgrespro:masterfrom
buriedpot:fix/forget_non_root_page_split_fpw

Conversation

@buriedpot
Copy link

@buriedpot buriedpot commented Feb 2, 2026

When we split non-root page, if FPW is not performed, PANIC or WARNING will occur on standby nodes. This commit fix this bug.

We can reproduce this bug with PG 18 (the newest released PG version) and RUM master branch.

  • Init a primary server and a standby server.
  • Turn full_page_writes to off.
  • Start the two servers.
  • Create RUM index on the primary server.
CREATE EXTENSION rum;
CREATE TABLE documents (
    id SERIAL PRIMARY KEY,
    content TEXT,
    content_tsvector TSVECTOR 
        GENERATED ALWAYS AS (to_tsvector('english', content)) STORED
);

INSERT INTO documents (content)
SELECT
    'The quick brown fox jumps over the lazy dog. ' ||
    'This is document number ' || g || '. ' ||
    'It contains some sample text for full-text search testing. ' ||
    CASE WHEN g % 3 = 0 THEN 'beautiful' ELSE '' END ||
    CASE WHEN g % 5 = 0 THEN 'situation' ELSE '' END ||
    CASE WHEN g % 7 = 0 THEN 'place' ELSE '' END
FROM generate_series(1, 1) AS g;

CREATE INDEX idx_documents_rum ON documents
USING rum (content_tsvector rum_tsvector_ops);
  • Continue inserting data into the table
INSERT INTO documents (content)
SELECT
    'The quick brown fox jumps over the lazy dog. ' ||
    'This is document add ' || g || '. ' ||
    'It contains some sample text for full-text search testing. ' ||
    CASE WHEN g % 3 = 0 THEN 'beautiful' ELSE '' END ||
    CASE WHEN g % 5 = 0 THEN 'situation' ELSE '' END ||
    CASE WHEN g % 7 = 0 THEN 'place' ELSE '' END
FROM generate_series(1, 10000) AS g;

Then the standby server will PANIC and crash.
image

Although full_page_writes is turned on by default, the new page should still be registered with GENERIC_XLOG_FULL_IMAGE flag, which is a standard behaviour.

Thank you for reviewing.

When we split non-root page, if FPW is not performed, PANIC or WARNING
will occur on standby nodes. We fix this bug in this commit.
@buriedpot buriedpot closed this Feb 2, 2026
@buriedpot buriedpot reopened this Feb 2, 2026
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.

1 participant