@@ -645,6 +645,8 @@ DecodeCommit(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
645
645
*/
646
646
strcpy (ctx -> reorder -> gid , parsed -> twophase_gid );
647
647
* ctx -> reorder -> state_3pc = '\0' ;
648
+ SnapBuildCommitTxn (ctx -> snapshot_builder , buf -> origptr , xid ,
649
+ parsed -> nsubxacts , parsed -> subxacts , true);
648
650
ReorderBufferCommitBareXact (ctx -> reorder , xid , buf -> origptr , buf -> endptr ,
649
651
commit_time , origin_id , origin_lsn );
650
652
} else {
@@ -699,9 +701,6 @@ DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
699
701
ReorderBufferXidSetCatalogChanges (rb , xid , buf -> origptr );
700
702
}
701
703
702
- SnapBuildCommitTxn (ctx -> snapshot_builder , buf -> origptr , xid ,
703
- parsed -> nsubxacts , parsed -> subxacts , false);
704
-
705
704
if (SnapBuildXactNeedsSkip (ctx -> snapshot_builder , buf -> origptr ) ||
706
705
(parsed -> dbId != InvalidOid && parsed -> dbId != ctx -> slot -> data .database ) ||
707
706
FilterByOrigin (ctx , origin_id ))
@@ -777,6 +776,8 @@ DecodeAbort(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
777
776
strcpy (ctx -> reorder -> gid , parsed -> twophase_gid );
778
777
* ctx -> reorder -> state_3pc = '\0' ;
779
778
779
+ SnapBuildAbortTxn (ctx -> snapshot_builder , buf -> record -> EndRecPtr , xid ,
780
+ parsed -> nsubxacts , parsed -> subxacts );
780
781
ReorderBufferCommitBareXact (ctx -> reorder , xid , buf -> origptr , buf -> endptr ,
781
782
commit_time , origin_id , origin_lsn );
782
783
}
0 commit comments