Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqwdK-001oVj-SL for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Oct 2023 14:25:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qqwdI-007hHr-HE for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Oct 2023 14:25:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqwdI-007hGn-7l for pgsql-hackers@lists.postgresql.org; Thu, 12 Oct 2023 14:25:48 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqwdG-0008jE-I8 for pgsql-hackers@postgresql.org; Thu, 12 Oct 2023 14:25:47 +0000 Received: from [192.168.7.133] (ip68-100-107-161.dc.dc.cox.net [68.100.107.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 10AF254689; Thu, 12 Oct 2023 14:25:46 +0000 (UTC) Message-ID: Date: Thu, 12 Oct 2023 10:25:45 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: The danger of deleting backup_label Content-Language: en-US To: Michael Paquier Cc: Pg Hackers References: <1330cb48-4e47-03ca-f2fb-b144b49514d8@pgmasters.net> <0e088834-aa39-ed09-3ec7-31c13c629a20@pgmasters.net> From: David Steele In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/11/23 18:22, Michael Paquier wrote: > On Tue, Oct 10, 2023 at 05:06:45PM -0400, David Steele wrote: >> That fails because there is a check to make sure the checkpoint is valid >> when pg_control is loaded. Another possibility is to use a special LSN like >> we use for unlogged tables. Anything >= 24 and < WAL segment size will work >> fine. > > Do we have any reason to do that in the presence of a backup_label > file anyway? We'll know the LSN of the checkpoint based on what the > base backup wants us to use. Using a fake-still-rather-valid value > for the LSN in the control file to bypass this check does not address > the issue you are pointing at: it is just avoiding this check. A > reasonable answer would be, IMO, to just not do this check at all > based on the control file in this case. Yeah, that's fair. And it looks like we are leaning towards excluding pg_control from the backup entirely, so the point is probably moot. >>> If the contents of the control file are tweaked before sending it >>> through a BASE_BACKUP, it would cover more than just pg_basebackup. >>> Switching the way the control file is sent with new contents in >>> sendFileWithContent() rather than sendFile() would be one way, for >>> instance.. >> >> Good point, and that makes this even more compelling. If we include >> pg_control into backup_label then there is no need to modify pg_control (as >> above) -- we can just exclude it from the backup entirely. That will >> certainly require some rejigging in recovery but seems worth it for backup >> solutions that can't easily modify pg_control. The C-based solutions can do >> this pretty easily but it is a pretty high bar for anyone else. > > I have little idea about that, but I guess that you are referring to > backrest here. Sure, pgBackRest, but there are other backup solutions written in C. My point is really that we should not depend on backup solutions being able to manipulate C structs. It looks the the solution we are working towards would not require that. Regards, -David