Re: [HACKERS] Create replication slot in pg_basebackup if requestedand not yet present
От | Michael Paquier |
---|---|
Тема | Re: [HACKERS] Create replication slot in pg_basebackup if requestedand not yet present |
Дата | |
Msg-id | CAB7nPqRr7BCHFrEhRiqvFzOFrqYpyRtiVV13Bi5f9-YiWAQhMA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] Create replication slot in pg_basebackup if requestedand not yet present (Michael Banck <michael.banck@credativ.de>) |
Ответы |
Re: [HACKERS] Create replication slot in pg_basebackup if requestedand not yet present
|
Список | pgsql-hackers |
On Tue, Mar 21, 2017 at 1:32 AM, Michael Banck <michael.banck@credativ.de> wrote: > On Mon, Mar 20, 2017 at 02:42:32PM +0300, Arthur Zakirov wrote: >> Also maybe it would be good if pg_basebackup had a way to drop created slot. >> Although "drop slot" is not related with concept of automatically created >> slots, it will good if user will have a way to drop slots. > > If you want to drop the slot after basebackup finishes you'd just use a > temporary slot (i.e. the default), or am I understanding your use-case > incorrectly? Yup, agreed. > I assumed the primary use-case for creating a non-temporary slot is to > keep it around while the standby is active. Indeed. /* + * Try to create a permanent replication slot if one is specified. Do + * not error out if the slot already exists, other errors are already + * reported by CreateReplicationSlot(). + */ + if (!stream->temp_slot && stream->replication_slot) + { + if (!CreateReplicationSlot(conn, stream->replication_slot, NULL, true, true)) + return false; + } This could be part of an else taken from the previous if where temp_slot is checked. There should be some TAP tests included. And +1 for sharing the same behavior as pg_receivewal. -- Michael
В списке pgsql-hackers по дате отправления: