pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Ian Barwick <ian.barwick@2ndquadrant.com>
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: Fri, 21 Jun 2019 11:24:52 -0400
Message-ID: <20190621152452.GN2480@tamriel.snowman.net> (raw)
In-Reply-To: <CA+TgmobVjrvVQB_gVytgBcPRmBvptN3wHQy5T6=dYCDZ5n5MGA@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>
	<27dc9f8d-8d8f-9dd1-0494-5d8bd2f49a45@2ndquadrant.com>
	<CA+TgmobVjrvVQB_gVytgBcPRmBvptN3wHQy5T6=dYCDZ5n5MGA@mail.gmail.com>

Greetings,

* Robert Haas (robertmhaas@gmail.com) wrote:
> On Mon, Jun 17, 2019 at 10:50 AM Ian Barwick
> <ian.barwick@2ndquadrant.com> wrote:
> > In Pg12, the code in pg_basebackup implies the correct thing to do is append to .auto.conf,
> > but as demonstrated that can cause problems with duplicate entries.
> 
> Yeah.
> 
> To me, forcing every tools author to use postgresql.conf parsing tools
> rather than just appending to the file is a needless burden on tool
> authors.  I'd vote for just having ALTER SYSTEM silently drop all but
> the last of duplicated entries.
> 
> It sounds like I might be in the minority, but I feel like the
> reactions which suggest that this is somehow heresy are highly
> overdone. Given that the very first time somebody wanted to do
> something like this in core, they picked this approach, I think we can
> assume that it is a natural approach which other people will also
> attempt. There doesn't seem to be any good reason for it not to Just
> Work.

That's not quite accurate, given that it isn't how the ALTER SYSTEM call
itself works, and clearly isn't how the authors of that feature expected
things to work or they would have actually made it work.  They didn't,
and it doesn't actually work.

The notion that pg_basebackup was correct in this, when it wasn't tested
at all, evidently, even after the concern was raised, and ALTER SYSTEM
was wrong, even though it worked just fine before some later patch
started making changes to the file, based on the idea that it's the
"natural approach" doesn't make sense to me.

If the change to pg_basebackup had included a change to ALTER SYSTEM to
make it work the *same* way that pg_basebackup now does, or at least to
work with the changes that pg_basebackup were making, then maybe
everything would have been fine.

That is to say, if your recommendation is to change everything that
modifies postgresql.auto.conf to *always* append (and maybe even include
a comment about when, and who, made the change..), and to make
everything work correctly with that, then that seems like it might be a
reasonable approach (though dealing with RESETs might be a little ugly..
haven't fully thought about that).

I still don't feel that having ALTER SYSTEM just remove duplicates is a
good idea and I do think it'll lead to confusion.

Thanks,

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (117+ messages)  latest in thread

Message-ID: <20190621152452.GN2480@tamriel.snowman.net>
Permalink:  ../20190621152452.GN2480@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20190621152452.GN2480@tamriel.snowman.net

 · 

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: sfrost@snowman.net, robertmhaas@gmail.com, ian.barwick@2ndquadrant.com, amit.kapila16@gmail.com
  Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
  In-Reply-To: <20190621152452.GN2480@tamriel.snowman.net>

* 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