]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Remove assertion for replication origins in PREPARE TRANSACTION
authorMichael Paquier <michael@paquier.xyz>
Tue, 14 Dec 2021 01:58:25 +0000 (10:58 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 14 Dec 2021 01:58:25 +0000 (10:58 +0900)
commit4be3e005e5da931aa816e3c04e1217c33de52fd6
treef1cc192a368e164f9804157168c48c75314587aa
parenta80fd2ae4cd4058b745959de1092f73810077779
Remove assertion for replication origins in PREPARE TRANSACTION

When using replication origins, pg_replication_origin_xact_setup() is an
optional choice to be able to set a LSN and a timestamp to mark the
origin, which would be additionally added to WAL for transaction commits
or aborts (including 2PC transactions).  An assertion in the code path
of PREPARE TRANSACTION assumed that this data should always be set, so
it would trigger when using replication origins without setting up an
origin LSN.  Some tests are added to cover more this kind of scenario.

Oversight in commit 1eb6d65.

Per discussion with Amit Kapila and Masahiko Sawada.

Discussion: https://postgr.es/m/YbbBfNSvMm5nIINV@paquier.xyz
Backpatch-through: 11
contrib/test_decoding/expected/replorigin.out
contrib/test_decoding/sql/replorigin.sql
src/backend/access/transam/twophase.c