Re: ERROR after writing PREPARE WAL record

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Asim R P <apraveen(at)pivotal(dot)io>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR after writing PREPARE WAL record
Date: 2019-07-17 13:37:20
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Asim R P <apraveen(at)pivotal(dot)io> writes:
> Cancel/terminate requests are held off during "PREPARE TRANSACTION"
> processing in function PrepareTransaction(). However, a subroutine invoked
> by PrepareTransaction() may perform elog(ERROR) or elog(FATAL).

Doing anything that's likely to fail in the post-commit code path is
a Bad Idea (TM). There's no good recovery avenue, so the fact that
you generally end up at a PANIC is expected/intentional.

The correct response, if you notice code doing that, is to fix it so
it doesn't do that. Typically the right answer is to move the
failure-prone operation to pre-commit processing.

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Chalke 2019-07-17 13:43:36 Re: block-level incremental backup
Previous Message Nikita Glukhov 2019-07-17 13:26:55 Re: Ltree syntax improvement