Re: ALTER TABLE lock strength reduction patch is unsafe

Поиск
Список
Период
Сортировка
Искать
От
Simon Riggs
Тема
Re: ALTER TABLE lock strength reduction patch is unsafe
Дата
Msg-id
CA+U5nM+mpKzanYe-0skJfB829QeBaauecen9oZqk2JBGWTu7fA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Peter Geoghegan <pg@heroku.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Vik Fearing <vik.fearing@dalibo.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Atri Sharma <atri.jiit@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Stephen Frost <sfrost@snowman.net>
Re: ALTER TABLE lock strength reduction patch is unsafe Alvaro Herrera <alvherre@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Stephen Frost <sfrost@snowman.net>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Stephen Frost <sfrost@snowman.net>
Re: ALTER TABLE lock strength reduction patch is unsafe Atri Sharma <atri.jiit@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Vik Fearing <vik.fearing@dalibo.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Alvaro Herrera <alvherre@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Greg Stark <stark@mit.edu>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Vik Fearing <vik.fearing@dalibo.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To: Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Atri Sharma <atri.jiit@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Atri Sharma <atri.jiit@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Atri Sharma <atri.jiit@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Noah Misch <noah@leadboat.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Jim Nasby <jim@nasby.net>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Peter Geoghegan <pg@heroku.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Bruce Momjian <bruce@momjian.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Bruce Momjian <bruce@momjian.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Alvaro Herrera <alvherre@2ndquadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Robert Haas <robertmhaas@gmail.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Tom Lane <tgl@sss.pgh.pa.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Heikki Linnakangas <hlinnakangas@vmware.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Bruce Momjian <bruce@momjian.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Heikki Linnakangas <hlinnakangas@vmware.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Bruce Momjian <bruce@momjian.us>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE lock strength reduction patch is unsafe Simon Riggs <simon@2ndQuadrant.com>
On 3 March 2014 16:36, Robert Haas  wrote:

>>> This hunk in ATRewriteCatalogs() looks scary:
>>>
>>> +       /*
>>> +        * If we think we might need to add/re-add toast tables then
>>> +        * we currently need to hold an AccessExclusiveLock.
>>> +        */
>>> +       if (lockmode < AccessExclusiveLock)
>>> +               return;
>>>
>>> It would make sense to me to add an Assert() or elog() check inside
>>> the subsequent loop to verify that the lock level is adequate ... but
>>> just returning silently seems like a bad idea.
>>
>> OK, I will check elog.
>>
>>> I have my doubts about whether it's safe to do AT_AddInherit,
>>> AT_DropInherit, AT_AddOf, or AT_DropOf with a full lock.  All of those
>>> can change the tuple descriptor, and we discussed, back when we did
>>> this the first time, the fact that the executor may get *very* unhappy
>>> if the tuple descriptor changes in mid-execution.  I strongly suspect
>>> these are unsafe with less than a full AccessExclusiveLock.
>>
>> I'm happy to change those if you feel there is insufficient evidence.
>
> Not sure what that means, but yes, I think the lock levels on those
> need to be increased.

v21 with all requested changes, comments and cleanup

-- 
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления
От: Andres Freund
Дата:
От: Robert Haas
Дата:
Сообщение: Re: Changeset Extraction v7.9
FAQ