Re: CLUSTER FREEZE

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: CLUSTER FREEZE
Дата
Msg-id 20131223115359.GA19795@alap2.anarazel.de
обсуждение исходный текст
Ответ на Re: CLUSTER FREEZE  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: CLUSTER FREEZE
Список pgsql-hackers
On 2013-12-22 20:45:02 -0500, Robert Haas wrote:
> I suspect we ought to extend this to rewriting variants of ALTER TABLE
> as well, but a little thought is needed there.  ATRewriteTables()
> appears to just call heap_insert() for each updated row, which if I'm
> not mistaken is an MVCC violation - offhand, it seems like a
> transaction with an older MVCC snapshot could access the table for
> this first time after the rewriter commits, and fail to see rows which
> would have appeared to be there before the rewrite. (I haven't
> actually tested this, so watch me be wrong.)  If we're OK with an MVCC
> violation here, we could just pass HEAP_INSERT_FROZEN and have a
> slightly different flavor of violation; if not, this needs some kind
> of more extensive surgery quite apart from what we do about freezing.

Yes, rewriting ALTER TABLEs certainly aren't MVCC safe. I thought that
was documented, but apparently not.
I am not sure it can be fixed easily using the tricks CLUSTER plays,
there might be nasty edge-cases because of the changes in the column
definition. Certainly not a trivial project.

I think we should leave ALTER TABLE as a completely separate project and
just improve CLUSTER for now. The practical impact of rewriting ALTER
TABLEs not freezing is far smaller, because they are very seldomly
performed in bigger databases.

Greetings,

Andres Freund

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: nested hstore patch
Следующее
От: Robert Haas
Дата:
Сообщение: Re: preserving forensic information when we freeze