File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/backend/replication/logical Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -592,8 +592,22 @@ apply_handle_rollback_prepared_txn(LogicalRepCommitData *commit_data)
592
592
replorigin_session_origin_lsn = commit_data -> end_lsn ;
593
593
replorigin_session_origin_timestamp = commit_data -> committime ;
594
594
595
- /* FIXME: it is ok if xact is absent */
596
- FinishPreparedTransaction (commit_data -> gid , false);
595
+ /* It is ok if xact is absent, currently AP might came after ABORT */
596
+ PG_TRY ();
597
+ {
598
+ FinishPreparedTransaction (commit_data -> gid , false);
599
+ }
600
+ PG_CATCH ();
601
+ {
602
+ ErrorData * errdata = CopyErrorData ();
603
+
604
+ /* re-throw if not 'xact absent' error */
605
+ if (errdata -> sqlerrcode != ERRCODE_UNDEFINED_OBJECT )
606
+ {
607
+ PG_RE_THROW ();
608
+ }
609
+ }
610
+ PG_END_TRY ();
597
611
CommitTransactionCommand ();
598
612
pgstat_report_stat (false);
599
613
You can’t perform that action at this time.
0 commit comments