Re: Assertion failure on hot standby

Поиск
Список
Период
Сортировка
Искать
От
Robert Haas
Тема
Re: Assertion failure on hot standby
Дата
Msg-id
AANLkTikfvLBOy2jmQNOkaPFic5ND7W4D6Mmesa--Y2qt@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Assertion failure on hot standby Fujii Masao <masao.fujii@gmail.com>
Re: Assertion failure on hot standby Fujii Masao <masao.fujii@gmail.com>
Re: Assertion failure on hot standby Simon Riggs <simon@2ndQuadrant.com>
Re: Assertion failure on hot standby Tom Lane <tgl@sss.pgh.pa.us>
Re: Assertion failure on hot standby Simon Riggs <simon@2ndQuadrant.com>
Re: Assertion failure on hot standby Robert Haas <robertmhaas@gmail.com>
Re: Assertion failure on hot standby Andres Freund <andres@anarazel.de>
Re: Assertion failure on hot standby Robert Haas <robertmhaas@gmail.com>
Re: Assertion failure on hot standby Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: Assertion failure on hot standby Simon Riggs <simon@2ndQuadrant.com>
Re: Assertion failure on hot standby Robert Haas <robertmhaas@gmail.com>
Re: Assertion failure on hot standby Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: Assertion failure on hot standby Robert Haas <robertmhaas@gmail.com>
Re: Assertion failure on hot standby Tom Lane <tgl@sss.pgh.pa.us>
Re: Assertion failure on hot standby Simon Riggs <simon@2ndQuadrant.com>
Re: Assertion failure on hot standby Robert Haas <robertmhaas@gmail.com>
Re: Assertion failure on hot standby Tom Lane <tgl@sss.pgh.pa.us>
Re: Assertion failure on hot standby Robert Haas <robertmhaas@gmail.com>
Re: Assertion failure on hot standby Fujii Masao <masao.fujii@gmail.com>
Re: Assertion failure on hot standby Simon Riggs <simon@2ndQuadrant.com>
On Fri, Nov 26, 2010 at 7:27 PM, Tom Lane  wrote:
>> In fact, now that I think about it, what I'm proposing would actually
>> substantially REDUCE the risk of deadlock on the standby, because the
>> master would only ever need to lock a backing file long enough to drop
>> or truncate it, whereas under the present system the startup process
>> might need to hold many locks at once.
>
> Now you're the one spouting nonsense.  Consider a master transaction
> that does
>
>        begin;
>        lock table foo;
>        alter table foo --- some rewriting table operation;
>        alter table foo --- some rewriting table operation;
>        alter table foo --- some rewriting table operation;
>        alter table foo --- some rewriting table operation;
>        alter table foo --- some rewriting table operation;
>        alter table foo --- some rewriting table operation;
>        alter table foo --- some rewriting table operation;
>        commit;
>
> On the master, no other transaction can see the intermediate states.
> We don't want that property to disappear on the slave.

And why would it?  Which states are visible is something that gets
controlled by MVCC, not by the order in which we remove backing files.

It's possible that to make what I'm describing work correctly, you
need to acquire the locks and then drop all the backing files, rather
than interleaving those operations.  I'm not sure about that.  But
acquiring them at the same point in WAL that master did seems quite
pointless - AFAICS, you lose nothing by postponing until commit time.

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

В списке pgsql-hackers по дате отправления
От: Quan Zongliang
Дата:
От: Robert Haas
Дата:
FAQ