Re: Prepared transaction releasing locks before deregistering its GID

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Oleksii Kliukin <alexk@hintbits.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-02-19T09:57:59Z
Lists: pgsql-hackers
On Tue, Feb 19, 2019 at 12:26:04PM +0300, Konstantin Knizhnik wrote:
> May be I missed something, but why it is not possible just to move removing
> 2PC GXact before releasing transaction locks:

Because we need to keep the 2PC reference in shared memory when
releasing the locks before removing the physical file.  The 2PC test
suite for recovery has good coverage, and I imagine that these blow up
with your suggestion (no time to test now, please see
009_twophase.pl).
--
Michael

Commits

  1. Make release of 2PC identifier and locks consistent in COMMIT PREPARED

  2. Fix incorrect function reference in comment of twophase.c

  3. Add TAP tests for 2PC post-commit callbacks of multixacts at recovery