We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent576d589 commit31495deCopy full SHA for 31495de
src/backend/replication/logical/worker.c
@@ -592,8 +592,22 @@ apply_handle_rollback_prepared_txn(LogicalRepCommitData *commit_data)
592
replorigin_session_origin_lsn=commit_data->end_lsn;
593
replorigin_session_origin_timestamp=commit_data->committime;
594
595
-/* FIXME: it is ok if xact is absent */
596
-FinishPreparedTransaction(commit_data->gid, false);
+/* It is ok if xact is absent, currently AP might came after ABORT */
+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();
611
CommitTransactionCommand();
612
pgstat_report_stat(false);
613