Re: pg_basebackup and replication slots

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: pg_basebackup and replication slots
Дата
Msg-id 55934368.2010907@gmx.net
обсуждение исходный текст
Ответ на pg_basebackup and replication slots  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: pg_basebackup and replication slots  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On 5/21/15 8:42 AM, Peter Eisentraut wrote:
> I wonder why pg_basebackup doesn't have any support for replication slots.
>
> When relying on replication slots to hang on to WAL data, there is a gap
> between when pg_basebackup finishes and streaming replication is started
> where WAL data could be thrown away by the primary.
>
> Looking at the code, the -X stream method could easily specify a
> replication slot.  (Might be nice if it could also create it in the same
> run.)

Here is a patch set for this.

(If you're looking at the patch and wondering why there is no code to
actually do anything with the replication slot, that's because the code
that does the WAL streaming is already aware of replication slots
because of the pg_receivexlog functionality that it also serves.  So all
that needs to be done is set replication_slot.)

See also the concurrent discussion on (optionally?) initializing
restart_lsn when the replication slot is created

(http://www.postgresql.org/message-id/flat/B8D538AC5587C84898B261FCB8C7D8A41FDE1017@ex10-mbx-36009.ant.amazon.com#B8D538AC5587C84898B261FCB8C7D8A41FDE1017@ex10-mbx-36009.ant.amazon.com),
which might have an impact on the details of this change.



Вложения

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Bug in bttext_abbrev_convert()
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Memory leak with XLogFileCopy since de768844 (WAL file with .partial)