8000 Always pass origin_lsn to rbtxn in DecodePrepare. · postgrespro/postgres_cluster@c5c69c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit c5c69c1

Browse files
committed
Always pass origin_lsn to rbtxn in DecodePrepare.
twophase.c forgets to set XACT_INFO_HAS_ORIGIN flag in prepare record, so without that origin_lsn is lost.
1 parent 30d248b commit c5c69c1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/replication/logical/decode.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,9 @@ static void
705705
DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
706706
xl_xact_parsed_prepare * parsed)
707707
{
708-
XLogRecPtr origin_lsn = InvalidXLogRecPtr;
708+
XLogRecPtr origin_lsn = parsed->origin_lsn;
709709
TimestampTz commit_time = parsed->xact_time;
710-
XLogRecPtr origin_id = XLogRecGetOrigin(buf->record);
710+
RepOriginId origin_id = XLogRecGetOrigin(buf->record);
711711
int i;
712712
TransactionId xid = parsed->twophase_xid;
713713
const char *gid = parsed->twophase_gid;
@@ -716,7 +716,6 @@ DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
716716

717717
if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)
718718
{
719-
origin_lsn = parsed->origin_lsn;
720719
commit_time = parsed->origin_timestamp;
721720
}
722721

0 commit comments

Comments
 (0)
0