Re: allow online change primary_conninfo - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: allow online change primary_conninfo
Date
Msg-id 20190216151025.GJ2240@paquier.xyz
Whole thread Raw
In response to Re: allow online change primary_conninfo  (Sergei Kornilov <sk@zsrv.org>)
Responses Re: allow online change primary_conninfo
List pgsql-hackers
On Sat, Feb 16, 2019 at 02:50:35PM +0300, Sergei Kornilov wrote:
> +    if ((strcmp(conninfo, PrimaryConnInfo) != 0 ||
> +         strcmp(slotname, PrimarySlotName) != 0) &&
> +        WalRcvRunning())
> +    {
> +        ereport(LOG,
> +                (errmsg("terminating walreceiver process due to change of %s",
> +                        strcmp(conninfo, PrimaryConnInfo) != 0 ? "primary_conninfo" : "primary_slot_name"),
> +                 errdetail("In a moment starts streaming WAL with new configuration.")));
> +
> +        ShutdownWalRcv();
> +        lastSourceFailed = true;
> +    }

If you do that, the startup process would try to jump to a different
source to fetch WAL if archiving is enabled.  Is that really what we
want?  It would be nice to have one message for primary_conninfo being
updated, and one for primary_slot_name so as if both are changed at
the same time the user gets the correct information.

"In a moment starts streaming WAL with new configuration." sounds
strange.  It would be more natural to have something like "The WAL
receiver is going to be restarted with the new configuration", just a
suggestion.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: ALTER TABLE on system catalogs
Next
From: Simon Riggs
Date:
Subject: Re: Compressed TOAST Slicing