Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions

From: Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Date: 2019-06-17 14:51:38
Message-ID: 952db979-def2-11f4-0bab-780cf5fe688b@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/17/19 2:58 AM, Magnus Hagander wrote:
> On Sun, Jun 16, 2019 at 7:43 PM Stephen Frost <sfrost(at)snowman(dot)net <mailto:sfrost(at)snowman(dot)net>> wrote:
>
>
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>) wrote:
> > Stephen Frost <sfrost(at)snowman(dot)net <mailto:sfrost(at)snowman(dot)net>> writes:
>
> > > what we should do is clean them up (and possibly
> > > throw a WARNING or similar at the user saying "something modified your
> > > postgresql.auto.conf in an unexpected way").  I'd suggest we do that on
> > > every ALTER SYSTEM call.
> >
> > +1 for having ALTER SYSTEM clean out duplicates.  Not sure whether
> > a WARNING would seem too in-your-face.
>
> I'd hope for a warning from basically every part of the system when it
> detects, clearly, that a file was changed in a way that it shouldn't
> have been.  If we don't throw a warning, then we're implying that it's
> acceptable, but then cleaning up the duplicates, which seems pretty
> confusing.
>
> > +1. Silently "fixing" the file by cleaning up duplicates is going to be even
> more confusing o uses who had seen them be there before.

Some sort of notification is definitely appropriate here.

However, going back to the original scenario (cascaded standby set up using
"pg_basebackup --write-recovery-conf") there would now be a warning emitted
the first time anyone executes ALTER SYSTEM (about duplicate "primary_conninfo"
entries) which would not have occured in Pg11 and earlier (and which will
no doubt cause consternation along the lines "how did my postgresql.auto.conf
get modified in an unexpected way? OMG? Bug? Was I hacked?").

Regards

Ian Barwick
--
Ian Barwick https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2019-06-17 14:52:47 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)
Previous Message Alvaro Herrera 2019-06-17 14:50:39 Re: Race conditions with TAP test for syncrep