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

Reply via email to