pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <ian.barwick@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Date: Sat, 3 Aug 2019 07:39:27 +0900
Message-ID: <c87c6599-8f60-754f-620d-c30faa0dceea@2ndquadrant.com> (raw)
In-Reply-To: <31697.1564784856@sss.pgh.pa.us>
References: <CA+TgmobVjrvVQB_gVytgBcPRmBvptN3wHQy5T6=dYCDZ5n5MGA@mail.gmail.com>
	<20372.1561134638@sss.pgh.pa.us>
	<20190621164028.GO2480@tamriel.snowman.net>
	<21353.1561136112@sss.pgh.pa.us>
	<CA+TgmoZVx-vco-39EN9MxO9BaG-oVY+NuDeZPGdS=_bX5VH70w@mail.gmail.com>
	<20190624185647.GW2480@tamriel.snowman.net>
	<15032.1561403529@sss.pgh.pa.us>
	<20190624192014.GB2480@tamriel.snowman.net>
	<56aff4f3-dec8-f462-7feb-0938411b04a6@2ndquadrant.com>
	<CAA4eK1+JMm=tvx720y6jhD8pdzt=HdS1-TwQwkARib2pwK8EvQ@mail.gmail.com>
	<20190802222254.qsvqjtkwte464lu3@development>
	<31697.1564784856@sss.pgh.pa.us>

On 8/3/19 7:27 AM, Tom Lane wrote:
> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
>> There seems to be a consensus that this this not a pg_basebackup issue
>> (i.e. duplicate values don't make the file invalid), and it should be
>> handled in ALTER SYSTEM.
> 
> Yeah.  I doubt pg_basebackup is the only actor that can create such
> situations.
> 
>> The proposal seems to be to run through the .auto.conf file, remove any
>> duplicates, and append the new entry at the end. That seems reasonable.
> 
> +1
> 
>> There was a discussion whether to print warnings about the duplicates. I
>> personally see not much point in doing that - if we consider duplicates
>> to be expected, and if ALTER SYSTEM has the license to rework the config
>> file any way it wants, why warn about it?
> 
> Personally I agree that warnings are unnecessary.

Having played around with the pg.auto.conf stuff for a while, my feeling is
that ALTER SYSTEM does indeed have a license to rewrite it (which is what
currently happens anyway, with comments and include directives [1] being silently
removed) so it seems reasonable to remove duplicate entries and ensure
the correct one is processed.

[1] suprisingly any include directives present are honoured, which seems crazy
to me, see: https://www.postgresql.org/message-id/flat/8c8bcbca-3bd9-dc6e-8986-04a5abdef142%402ndquadrant.com

>> The main issue however is that no code was written yet.
> 
> Seems like it ought to be relatively simple ... but I didn't look.

The patch I originally sent does exactly this.

The thread then drifted off into a discussion about providing ways for
applications to properly write to pg.auto.conf while PostgreSQL is not
running; I have a patch for that which I can submit later (though it
is a thing of considerable ugliness).


Regards

Ian Barwick

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





view thread (117+ messages)  latest in thread

Message-ID: <c87c6599-8f60-754f-620d-c30faa0dceea@2ndquadrant.com>
Permalink:  ../c87c6599-8f60-754f-620d-c30faa0dceea@2ndquadrant.com/
Also on:    postgresql.org/message-id/c87c6599-8f60-754f-620d-c30faa0dceea@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, tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com, amit.kapila16@gmail.com, sfrost@snowman.net, robertmhaas@gmail.com
  Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
  In-Reply-To: <c87c6599-8f60-754f-620d-c30faa0dceea@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