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 MVCC bug with prepared xact with subxacts on standby #8152

Merged
merged 1 commit into from
Jun 25, 2024

Commits on Jun 25, 2024

  1. Fix MVCC bug with prepared xact with subxacts on standby

    We did not recover the subtransaction IDs of prepared transactions
    when starting a hot standby from a shutdown checkpoint. As a result,
    such subtransactions were considered as aborted, rather than
    in-progress. That would lead to hint bits being set incorrectly, and
    the subtransactions suddenly becoming visible to old snapshots when
    the prepared transaction was committed.
    
    To fix, update pg_subtrans with prepared transactions's subxids when
    starting hot standby from a shutdown checkpoint. The snapshots taken
    from that state need to be marked as "suboverflowed", so that we also
    check the pg_subtrans.
    
    Discussion: https://www.postgresql.org/message-id/6b852e98-2d49-4ca1-9e95-db419a2696e0%40iki.fi
    
    NEON: cherry-picked from the upstream thread ahead of time, to unblock
    #7288. I expect this to be
    committed to upstream in the next few days, superseding this. NOTE: I
    did not include the new regression test on v15 and v14 branches,
    because the test would need some adapting, and we don't run the perl
    tests on Neon anyway.
    hlinnaka committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    1a69cc2 View commit details
    Browse the repository at this point in the history