Content-Length: 283193 | pFad | http://github.com/postgrespro/postgres_cluster/commit/31495ded1b062285a827d9298314181e9e54fc45

4A ABORT PREPARED due to non-existent xact in apply worker failure is fine. · postgrespro/postgres_cluster@31495de · GitHub
Skip to content

Commit 31495de

Browse files
committed
ABORT PREPARED due to non-existent xact in apply worker failure is fine.
1 parent 576d589 commit 31495de

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/backend/replication/logical/worker.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,22 @@ apply_handle_rollback_prepared_txn(LogicalRepCommitData *commit_data)
592592
replorigen_session_origen_lsn = commit_data->end_lsn;
593593
replorigen_session_origen_timestamp = commit_data->committime;
594594

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();
597611
CommitTransactionCommand();
598612
pgstat_report_stat(false);
599613

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/31495ded1b062285a827d9298314181e9e54fc45

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy