Re: Race condition between PREPARE TRANSACTION and COMMIT PREPARED (was Re: Problem with txid_snapshot_in/out() functionality)

Поиск
Список
Период
Сортировка
Искать
От
Andres Freund
Тема
Re: Race condition between PREPARE TRANSACTION and COMMIT PREPARED (was Re: Problem with txid_snapshot_in/out() functionality)
Дата
Msg-id
20140414175144.GZ4161@awork2.anarazel.de
Ответ на
Список
Дерево обсуждения
Problem with txid_snapshot_in/out() functionality Jan Wieck <jan@wi3ck.info>
Re: Problem with txid_snapshot_in/out() functionality Heikki Linnakangas <hlinnakangas@vmware.com>
Re: Problem with txid_snapshot_in/out() functionality Andres Freund <andres@2ndquadrant.com>
Re: Problem with txid_snapshot_in/out() functionality Jan Wieck <jan@wi3ck.info>
Re: Problem with txid_snapshot_in/out() functionality Tom Lane <tgl@sss.pgh.pa.us>
Re: Problem with txid_snapshot_in/out() functionality Andres Freund <andres@2ndquadrant.com>
Re: Problem with txid_snapshot_in/out() functionality Jan Wieck <jan@wi3ck.info>
Re: Problem with txid_snapshot_in/out() functionality Marko Kreen <markokr@gmail.com>
Re: Problem with txid_snapshot_in/out() functionality Jan Wieck <jan@wi3ck.info>
Re: Problem with txid_snapshot_in/out() functionality Jan Wieck <jan@wi3ck.info>
Re: Problem with txid_snapshot_in/out() functionality Marko Kreen <markokr@gmail.com>
Re: Problem with txid_snapshot_in/out() functionality Heikki Linnakangas <hlinnakangas@vmware.com>
Race condition between PREPARE TRANSACTION and COMMIT PREPARED (was Re: Problem with txid_snapshot_in/out() functionality) Heikki Linnakangas <hlinnakangas@vmware.com>
Re: Race condition between PREPARE TRANSACTION and COMMIT PREPARED (was Re: Problem with txid_snapshot_in/out() functionality) Andres Freund <andres@2ndquadrant.com>
Re: Problem with txid_snapshot_in/out() functionality Heikki Linnakangas <hlinnakangas@vmware.com>
Re: Problem with txid_snapshot_in/out() functionality Andres Freund <andres@2ndquadrant.com>
Re: Problem with txid_snapshot_in/out() functionality Jan Wieck <jan@wi3ck.info>
Re: Problem with txid_snapshot_in/out() functionality Greg Stark <stark@mit.edu>
Re: Problem with txid_snapshot_in/out() functionality Jan Wieck <jan@wi3ck.info>
Re: Problem with txid_snapshot_in/out() functionality Andres Freund <andres@2ndquadrant.com>
Re: Problem with txid_snapshot_in/out() functionality Jan Wieck <jan@wi3ck.info>
On 2014-04-14 13:47:35 -0400, Tom Lane wrote:
> Andres Freund  writes:
> > I wonder if the most natural way to express this wouldn't be to have a
> > heavyweight lock for every 2pc xact
> > 'slot'. ResourceOwnerRelease(RESOURCE_RELEASE_LOCKS) should be scheduled
> > correctly to make error handling for this work.
> 
> That seems like not a bad idea.  Could we also use the same lock to
> prevent concurrent attempts to commit/rollback the same already-prepared
> transaction?  I forget what we're doing to forestall such cases right now.

GlobalTransaction->locking_xid is currently used. If it points to a live
transaction by another backned "prepared transaction with identifier
\"%s\" is busy" will be thrown.
ISTM if there were using a lock for every slot, that logic couldbe
thrown away.

Greetings,

Andres Freund

-- Andres Freund	                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services


В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
FAQ