FinishPreparedTransaction missing HOLD_INTERRUPTS section

Stas Kelvich <s.kelvich@postgrespro.ru>

From: Stas Kelvich <s.kelvich@postgrespro.ru>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-27T21:36:16Z
Lists: pgsql-hackers

Attachments

Hello.

It seems that during COMMIT PREPARED FinishPreparedTransaction() doesn't
hold interrupts around writing to wal and cleaning up ProcArray and GXact
entries. At least RemoveTwoPhaseFile (which is called in between) can print
a warning with ereport(), which, in turn will check for interrupts and
therefore can cancel backend or throw an error before GXact clean-up.

Other similar places like CommitTransaction and PrepareTransaction have
such hold interrupts sections.

--
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Add HOLD_INTERRUPTS section into FinishPreparedTransaction.