Re: Race condition between PREPARE TRANSACTION and COMMIT PREPARED (was Re: Problem with txid_snapshot_in/out() functionality) - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Race condition between PREPARE TRANSACTION and COMMIT PREPARED (was Re: Problem with txid_snapshot_in/out() functionality)
Date
Msg-id CA+TgmoayHJGRknvbvzTgwOB6pio=bxqyuRRmhtUiMt9Kw+ntcQ@mail.gmail.com
Whole thread Raw
In response to Re: Race condition between PREPARE TRANSACTION and COMMIT PREPARED (was Re: Problem with txid_snapshot_in/out() functionality)  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On Thu, May 15, 2014 at 10:38 AM, Andres Freund <andres@2ndquadrant.com> wrote:
>> <shrug>. async.c and namespace.c does the same, and it hasn't been a
>> problem.
>
> Well, it doesn't seem unreasonable to have C code using
> PG_ENSURE_ERROR_CLEANUP/PG_END_ENSURE_ERROR_CLEANUP around a 2pc commit
> to me. That'll break with this.
> Perhaps we should just finally make cancel_before_shmem_exit search the
> stack of callbacks.

Yes, please.  And while we're at it, perhaps we should make it Trap()
or fail an Assert() if it doesn't find the callback it was told to
remove.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers
Next
From: Jeff Janes
Date:
Subject: autovacuum scheduling starvation and frenzy