Re: allow online change primary_conninfo

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: allow online change primary_conninfo
Дата
Msg-id 20190216035316.6q23okurzacergea@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: allow online change primary_conninfo  (Sergei Kornilov <sk@zsrv.org>)
Ответы Re: allow online change primary_conninfo  (Sergei Kornilov <sk@zsrv.org>)
Список pgsql-hackers
Hi,

On 2019-02-03 15:33:38 +0300, Sergei Kornilov wrote:
> +/*
> + * Actual processing SIGHUP signal
> + */
> +static void
> +ProcessWalRcvSigHup(void)
> +{
> +    ProcessConfigFile(PGC_SIGHUP);
> +
> +    /*
> +     * If primary_conninfo has been changed while walreceiver is running,
> +     * shut down walreceiver so that a new walreceiver is started and
> +     * initiates replication with the new connection information.
> +     */
> +    if (strcmp(current_conninfo, PrimaryConnInfo) != 0)
> +        ereport(FATAL,
> +                (errcode(ERRCODE_ADMIN_SHUTDOWN),
> +                 errmsg("terminating walreceiver process due to change of primary_conninfo"),
> +                 errdetail("In a moment starts streaming WAL with new configuration.")));
> +
> +    /*
> +     * And the same for primary_slot_name.
> +     */
> +    if (strcmp(current_slotname, PrimarySlotName) != 0)
> +        ereport(FATAL,
> +                (errcode(ERRCODE_ADMIN_SHUTDOWN),
> +                 errmsg("terminating walreceiver process due to change of primary_slot_name"),
> +                 errdetail("In a moment starts streaming WAL with new configuration.")));
> +
> +    XLogWalRcvSendHSFeedback(true);
> +}

I don't quite think this is the right design. IMO the startup process
should signal the walreceiver to shut down, and the wal receiver should
never look at the config. Otherwise there's chances for knowledge of
pg.conf to differ between the processes.

Greetings,

Andres Freund


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Remove Deprecated Exclusive Backup Mode