Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcsz7-0005Lr-Ik for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jun 2019 14:51:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hcsz6-0007qh-E1 for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jun 2019 14:51:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcsz6-0007nX-2y for pgsql-hackers@lists.postgresql.org; Mon, 17 Jun 2019 14:51:48 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcsz2-0007A2-RJ for pgsql-hackers@postgresql.org; Mon, 17 Jun 2019 14:51:47 +0000 Received: by mail-pg1-x541.google.com with SMTP id 196so5960811pgc.6 for ; Mon, 17 Jun 2019 07:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=I3FtDuCzGPMMHMIz6WMLsD4VLSK1z8E2SiblGDNzAY0=; b=fa+spFsVYGoHYlCLvVp3hGNMlyHpBpa4OJLyTGKLvw7GFagayJ8YCG4pGqgc29iILv 7VT+Us1gl5cx956G/Tf/ZJC67UkcamZVnBxdXWDfaPcY6sxeIdUdyLLGyFkjOE+TzeRl 3UqfFkX3hj27fOb9yN9LV07vw1QcL7EFH99mEuHJDrobNXRkrO6cpyLwwjAt7XelGtBP NG9XlhrDyqEk2jdrC130NHZaE4XsK6xBa6+ZW8bFJDUNx5CvzMS1CRkflDHo839z44fv x0gD3G4W+G8efZR/8soiBLsHMQ04x5DJhH89jJcDcOkPY113cq9qDAgyRDrIlxEqE0OM cZkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I3FtDuCzGPMMHMIz6WMLsD4VLSK1z8E2SiblGDNzAY0=; b=kjOGNli0Asq8AMC/l1rf4/nGWKj8hNajZjh8esmdRWiXuQyORoaHF1jONCTZT2ptrE 79T4DjRolbhQo4n11xeCSUwi3kBSFzOLZFD2hjmksBVAEESe6lxKN/x8d4CGntvFqTr3 r0tCMMaxfNbIl2UU9o1nOa4swCBcwxUkmNEp7H+a0iWxubfvk2CWLUUq0cy2+8ClveOW Yn/7Yy0bFpldrW4Wyhj22WRLD1TWZKBcWk+BBY7sc88MMKySH1FQ+qFsL7jNxjVhtg0G Wujj509rs8CUb6evNscm+YVirhbj/NSTmWv0Usj3ewQcVI/zrVIMGp8v67nW5adm5Qma VJAw== X-Gm-Message-State: APjAAAUZE549NriXd+/NTmZiro5nVisyg46OGF6GxU9Arvp5zHLmuerD /y7CuQsCGOuH24B4D5ZhRrPo2SV3ArNpbA6FJ3mpngdRSJp0HKKEpgHuwSFvCQPhyv6wOlvbbby 29jEbmXDr+2Apya+jW6A/xWpaxGtpBJPohWW5SoYAFaHnvfJ5kQmf8euF2vLpd7wX20QZq+zGlb DPz0dXUmfWDAFx X-Google-Smtp-Source: APXvYqz+mW2zfLXBLpfraj9t+T4ggc1wkuwNZVZ8/OvQGBmqq82XewsrTSHcxvo55C6VQqqFLG/wBA== X-Received: by 2002:a62:3741:: with SMTP id e62mr115325363pfa.213.1560783102505; Mon, 17 Jun 2019 07:51:42 -0700 (PDT) Received: from osaka.octopusnet (p14091-ipngn9701marunouchi.tokyo.ocn.ne.jp. [153.219.173.91]) by smtp.gmail.com with ESMTPSA id d132sm13660272pfd.61.2019.06.17.07.51.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 07:51:41 -0700 (PDT) Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions To: Magnus Hagander , Stephen Frost Cc: Tom Lane , Amit Kapila , "pgsql-hackers@postgresql.org" References: <20190614160835.GF2480@tamriel.snowman.net> <20190616171610.GO2480@tamriel.snowman.net> <5218.1560705699@sss.pgh.pa.us> <20190616174332.GR2480@tamriel.snowman.net> From: Ian Barwick Message-ID: <952db979-def2-11f4-0bab-780cf5fe688b@2ndquadrant.com> Date: Mon, 17 Jun 2019 23:51:38 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/17/19 2:58 AM, Magnus Hagander wrote: > On Sun, Jun 16, 2019 at 7:43 PM Stephen Frost > wrote: > > > * Tom Lane (tgl@sss.pgh.pa.us ) wrote: > > Stephen Frost > 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