summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-12-14 10:58:33 +0900
committerMichael Paquier <michael@paquier.xyz>2021-12-14 10:58:33 +0900
commit65af1e842208cf3edec3b74842eec87b4a0138e5 (patch)
treee8cc0480b694dcb4ba63165ce5415d832939d2a5 /src
parenta5fe66bfdaec7add9381b61b33f5c361eaacd055 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/twophase.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c
index e727e55b330..6def1820caf 100644
--- a/src/backend/access/transam/twophase.c
+++ b/src/backend/access/transam/twophase.c
@@ -1151,7 +1151,6 @@ EndPrepare(GlobalTransaction gxact)
if (replorigin)
{
- Assert(replorigin_session_origin_lsn != InvalidXLogRecPtr);
hdr->origin_lsn = replorigin_session_origin_lsn;
hdr->origin_timestamp = replorigin_session_origin_timestamp;
}