Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nP7Il-0006Kk-H1 for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Mar 2022 18:32:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nP7Ij-0004KY-TI for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Mar 2022 18:32:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nP7Ij-0004KO-K7 for pgsql-hackers@lists.postgresql.org; Tue, 01 Mar 2022 18:32:45 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nP7Ih-000804-3Y for pgsql-hackers@lists.postgresql.org; Tue, 01 Mar 2022 18:32:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GXyi/YRyB4YTTp1sNG1XtXViVZpK5Lq7sED3J4l6vj8=; b=HfMCVqaZCEHrGcrap6wXfvGxjz wWTjhlGhOM1Z3Ia1gzkLF4S8ubLjtPjHiXjOzo/n9bvEvvSmGwqiebWSsGS0vyqmKHVAe9f346H0j j6OPjYE3G9P1LdOim+rnSq+oKsl0GAu4KFK9Lwf4lpUo1wSmqwtJ4fEH0D0mHXbeG3whpw2LMT2Hi pCe6bYS3XAtmqUJmWC29dEqZ0RgsR7aReIHwk1K0xLZvlPr6paT7BJc8rB/oeEGjE3sczHKQicz3P Kl0VuTIljZq8NFnwk5OESNdoBE95yNtl5D8UByUISJrcC5m1yCveJRSseQ7aYMOBoTom96BaFtEHu 1o8n88Sg==; Received: from 50-102-16-206.prtg.in.frontiernet.net ([50.102.16.206]:48286) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nP7If-00260m-9R; Tue, 01 Mar 2022 13:32:41 -0500 Subject: Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file To: Nathan Bossart References: <20220221172306.GA3698472@nathanxps13> <164589413251.1035.2695761148079719188.pgcf@coridan.postgresql.org> <20220226220614.GA673898@nathanxps13> <20220301055100.GA1002387@nathanxps13> <621E4529.1090601@anastigmatix.net> <20220301173208.GB1031413@nathanxps13> Cc: David Steele , pgsql-hackers@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <621E66C7.3070809@anastigmatix.net> Date: Tue, 1 Mar 2022 13:32:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <20220301173208.GB1031413@nathanxps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 03/01/22 12:32, Nathan Bossart wrote: > On Tue, Mar 01, 2022 at 11:09:13AM -0500, Chapman Flack wrote: >> That way, at least, there would be a period of time where procedures >> that currently work (by passing exclusive => false) would continue to work, >> and could be adapted as time permits by removing that argument, with no >> behavioral change. > > I'm not sure if there's any advantage to kicking the can down the road. At > some point, we'll need to break existing backup scripts. Will we be more > prepared to do that in v17 than we are now? Yes, if we have provided a transition period the way we did in 7117685. The way the on-ramp to that transition worked: - Initially, your procedures used exclusive mode. - If you changed nothing, they continued to work, with no behavior change. - You then had ample time to adapt them to non-exclusive mode so now they work that way. - You knew a day would come (here it comes) where, if you've never gotten around to doing that, your unchanged exclusive-mode procedures are going to break. So here we are, arrived at that day. If you're still using exclusive mode, your stuff's going to break; serves you right. So now limit the cases we care about to people who made use of the time they were given to change their procedures to use exclusive => false. So the off-ramp can look like: - Initially, your procedures pass exclusive => false. - If you change nothing, they should continue to work, with no behavior change. - You should then have ample time to change to a new spelling without exclusive => false, and have them work that way. - You know some later day is coming where, if you've never gotten around to doing that, they're going to break. Then, when that day comes, if you're still passing exclusive at all, your stuff's going to break; serves you right. If you have made use of the time you were given for the changes, you'll be fine. So yes, at that point, I think we can do it with clear conscience. We'll have made the off-ramp as smooth and navigable as the on-ramp was. > We could maintain two sets of > functions for a few releases and make it really clear in the documentation > that pg_start/stop_backup() are going to be removed soon (and always emit a > WARNING when they are used). Would that address your concerns? That would. I had been thinking of not changing the names, and just making the parameter go away. But I wasn't thinking of your concern here: > What we need to do is make sure that an older installation won't silently > work in a broken way, i.e. if we remove the exclusive flag somebody > expecting the pre-9.6 behavior might not receive an error and think > everything is OK. That would not be good. So I'm ok with changing the names. Then step 3 of the off-ramp would just be to call the functions by the new names, as well as to drop the exclusive => false. The thing I'd want to avoid is just, after the trouble that was taken to make the on-ramp navigable, making the off-ramp be a cliff. Regards, -Chap