pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <ian.barwick@2ndquadrant.com>
To: Magnus Hagander <magnus@hagander.net>
To: Stephen Frost <sfrost@snowman.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Date: Mon, 17 Jun 2019 23:51:38 +0900
Message-ID: <952db979-def2-11f4-0bab-780cf5fe688b@2ndquadrant.com> (raw)
In-Reply-To: <CABUevEzejvEMR9BgHvYyv1mXcHbs9+x8LZv-UkUohwTg9o7o6A@mail.gmail.com>
References: <aed6cc9f-98f3-2693-ac81-52bb0052307e@2ndquadrant.com>
	<20190614160835.GF2480@tamriel.snowman.net>
	<CAA4eK1JW9UfLOtMEJq5b_YcogbWdxzAGUzNi72F2Xx4r1_h6QA@mail.gmail.com>
	<20190616171610.GO2480@tamriel.snowman.net>
	<5218.1560705699@sss.pgh.pa.us>
	<20190616174332.GR2480@tamriel.snowman.net>
	<CABUevEzejvEMR9BgHvYyv1mXcHbs9+x8LZv-UkUohwTg9o7o6A@mail.gmail.com>

On 6/17/19 2:58 AM, Magnus Hagander wrote:
> On Sun, Jun 16, 2019 at 7:43 PM Stephen Frost <sfrost@snowman.net <mailto:sfrost@snowman.net>> wrote:
> 
> 
>     * Tom Lane (tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us>) wrote:
>      > Stephen Frost <sfrost@snowman.net <mailto:sfrost@snowman.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





view thread (117+ messages)  latest in thread

Message-ID: <952db979-def2-11f4-0bab-780cf5fe688b@2ndquadrant.com>
Permalink:  ../952db979-def2-11f4-0bab-780cf5fe688b@2ndquadrant.com/
Also on:    postgresql.org/message-id/952db979-def2-11f4-0bab-780cf5fe688b@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ian.barwick@2ndquadrant.com, magnus@hagander.net, sfrost@snowman.net, tgl@sss.pgh.pa.us, amit.kapila16@gmail.com
  Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
  In-Reply-To: <952db979-def2-11f4-0bab-780cf5fe688b@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox