Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit31495de

Browse files
committed
ABORT PREPARED due to non-existent xact in apply worker failure is fine.
1 parent576d589 commit31495de

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
replorigin_session_origin_lsn=commit_data->end_lsn;
593593
replorigin_session_origin_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)

[8]ページ先頭

©2009-2025 Movatter.jp