Re: Prepared transaction releasing locks before deregistering its GID

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Oleksii Kliukin <alexk@hintbits.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-02-19T11:54:31Z
Lists: pgsql-hackers
On Tue, Feb 19, 2019 at 10:59:33AM +0100, Oleksii Kliukin wrote:
> Michael Paquier <michael@paquier.xyz> wrote:
>> If you run two transactions in parallel using your script, the second
>> transaction would wait at LOCK time until the first transaction
>> releases its locks with the COMMIT PREPARED.
> 
> That is the desired outcome, right?

Yes, that is the correct one in my opinion, and we should not have GID
conflicts when running the scenario you provided upthread.
--
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