Re: [HACKERS] Adding hook in BufferSync for backup purposes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Adding hook in BufferSync for backup purposes
Дата
Msg-id 21401.1502113050@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Adding hook in BufferSync for backup purposes  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: [HACKERS] Adding hook in BufferSync for backup purposes  (Andrey Borodin <x4mmm@yandex-team.ru>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> I suppose your hook idea lets you implement the LSN fork in an
> extension, rather than having it be part of core.  The idea of hooking
> onto BufferSync makes me uneasy, though -- like it's not the correct
> place to do it.

Yeah.  Keep in mind that if the extension does anything at all that could
possibly throw an error, and if that error condition persists across
multiple tries, you will have broken the database completely: it will
be impossible to complete a checkpoint, and your WAL segment pool will
grow until it exhausts disk.  So the idea of doing something that involves
unspecified extension behavior, especially possible interaction with
an external backup agent, right there is pretty terrifying.

Other problems with the proposed patch: it misses coverage of
BgBufferSync, and I don't like exposing an ad-hoc structure like
CkptTsStatus as part of an extension API.  The algorithm used by
BufferSync to schedule buffer writes has changed multiple times
before and doubtless will again; if we're going to have a hook
here it should depend as little as possible on those details.
        regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Subscription code improvements
Следующее
От: Robins Tharakan
Дата:
Сообщение: Re: [HACKERS] Patch: Add --no-comments to skip COMMENTs with pg_dump