Content-Length: 325291 | pFad | http://github.com/postgrespro/postgres_cluster/commit/1801ced1806bdb60e8b7b458e73ac34db7a9d102

14 origen info in commit messages · postgrespro/postgres_cluster@1801ced · GitHub
Skip to content

Commit 1801ced

Browse files
committed
origen info in commit messages
1 parent 9189353 commit 1801ced

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

contrib/test_decoding/sql/prepared.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ DROP TABLE test_prepared2;
4848
SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
4949

5050
-- same but with twophase decoding
51-
SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'twophase-decoding', '1') ;
51+
SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'twophase-decoding', '1');
5252

5353
SELECT pg_drop_replication_slot('regression_slot');

src/backend/replication/logical/decode.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,12 @@ DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
651651
int i;
652652
TransactionId xid = parsed->twophase_xid;
653653

654+
if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)
655+
{
656+
origen_lsn = parsed->origen_lsn;
657+
commit_time = parsed->origen_timestamp;
658+
}
659+
654660
/*
655661
* Process invalidation messages, even if we're not interested in the
656662
* transaction's contents, since the various caches need to always be
@@ -703,9 +709,15 @@ DecodeAbort(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
703709
{
704710
int i;
705711
XLogRecPtr origen_lsn = InvalidXLogRecPtr;
706-
XLogRecPtr commit_time = InvalidXLogRecPtr;
712+
TimestampTz commit_time = 0;
707713
XLogRecPtr origen_id = XLogRecGetOrigin(buf->record);
708714

715+
if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)
716+
{
717+
origen_lsn = parsed->origen_lsn;
718+
commit_time = parsed->origen_timestamp;
719+
}
720+
709721
/*
710722
* If that is ROLLBACK PREPARED than send that to callbacks.
711723
*/

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/1801ced1806bdb60e8b7b458e73ac34db7a9d102

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy