Fix an oversight in ReorderBufferFinishPrepared.
authorAmit Kapila <akapila@postgresql.org>
Tue, 23 Feb 2021 04:17:41 +0000 (09:47 +0530)
committerAmit Kapila <akapila@postgresql.org>
Tue, 23 Feb 2021 04:17:41 +0000 (09:47 +0530)
We don't have anything to decode in a transaction if ReorderBufferTXN
doesn't exist by the time we decode the commit prepared. So don't create a
new ReorderBufferTXN here. This is an oversight in commit a271a1b5.

Reported-by: Markus Wanner
Discussion: https://postgr.es/m/dbec82e2-dbd7-95a2-c6b6-e488cbbdf853@bluegap.ch

src/backend/replication/logical/reorderbuffer.c

index 5a62ab8bbc1ac98a6b862050011299e92f71ccaa..66554ca2d98483c05aa3c32e52044a573750a9d9 100644 (file)
@@ -2679,7 +2679,7 @@ ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid,
    XLogRecPtr  prepare_end_lsn;
    TimestampTz prepare_time;
 
-   txn = ReorderBufferTXNByXid(rb, xid, true, NULL, commit_lsn, false);
+   txn = ReorderBufferTXNByXid(rb, xid, false, NULL, commit_lsn, false);
 
    /* unknown transaction, nothing to do */
    if (txn == NULL)