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.96) (envelope-from ) id 1w2pzN-000eY3-0H for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 12:27:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2pzL-00AYIg-2w for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 12:27:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2pzL-00AYIY-1p for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 12:27:03 +0000 Received: from flamingo.ash.relay.mailchannels.net ([23.83.222.60]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w2pzI-00000000vbp-29TC for pgsql-hackers@postgresql.org; Wed, 18 Mar 2026 12:27:03 +0000 X-Sender-Id: hostingeremail|x-authuser|david@pgbackrest.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 5563C222F0D; Wed, 18 Mar 2026 12:26:56 +0000 (UTC) Received: from fr-int-smtpout29.hostinger.io (100-113-205-212.trex-nlb.outbound.svc.cluster.local [100.113.205.212]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id C8419222868; Wed, 18 Mar 2026 12:26:53 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; d=mailchannels.net; s=arc-2022; cv=none; t=1773836815; b=O+JSaz6/TqItSkGihXIzAT/GC2WQcmRmEwndVC5XGK/bwvGrEvhpD2WfGMs8hRPYuUp/dK j96511V37VtjA3bx91YkgobX8xL64dSQfkp97akMiU87Vd7fhSnIGC2Mp9Ez8y2c/3xdSn eaeW4Eb4dTXGtI6eMhXeFT1vZXkRToDekbK45ul+UCxudGg2SwDl/L1NCYnrb2WS7gwrFP EVe7ApW7BTlfyrawVY8G7ZRFM52cn0Z0mukb0l6XztNz2UInJaL/X07MgJY731bzWjVWJp 7aUq95G3fnUAqBw1unPbbq+Z5kgUoa20Kf0saEPjVQmRZet49CI90C8nPvidQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1773836815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fvo/04SjRQIqclt3RB1H+z5qWEI8OX1uWCfYqrrYXLg=; b=lRC52bBbh7/AAz2rwyWS4M0NFOPkTh0pPvE6jvKpJKJlGS2VvnUHcgMF5nmj6ZG7kND8IZ EFVSEX1jBodliwNSr6EBQEWaJo5+1bfUdihCPVqCZ/ewg5JLxovTs/h1nM7yFwEKAuaBII XML4d7HwIA4R0vOqMkvzxKDtjk4iRynTg0ue2ITuehFIdbBy3mmbIVBMNf4JylneDqmwdy 07LDPut3NanPNCepc90u06woTNCavAf2e4b3c1T5KDaVOmE3artIfyU95Sln6E7nQG+PqQ Ih0H/ouBuVg2ALqwxCRF+P6ZEMfDxOeo/YyYJdVM+KsIi5fonJs10eOE+viN4A== ARC-Authentication-Results: i=1; rspamd-7f98bb5847-c7lj4; auth=pass smtp.auth=hostingeremail smtp.mailfrom=david@pgbackrest.org X-Sender-Id: hostingeremail|x-authuser|david@pgbackrest.org X-MC-Relay: Neutral X-MailChannels-SenderId: hostingeremail|x-authuser|david@pgbackrest.org X-MailChannels-Auth-Id: hostingeremail X-Abiding-Robust: 373fa760762b1f22_1773836816154_3390325474 X-MC-Loop-Signature: 1773836816154:1129720071 X-MC-Ingress-Time: 1773836816154 Received: from fr-int-smtpout29.hostinger.io (fr-int-smtpout29.hostinger.io [148.222.54.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.113.205.212 (trex/7.1.5); Wed, 18 Mar 2026 12:26:56 +0000 Received: from [10.5.0.2] (unknown [185.219.141.124]) (Authenticated sender: david@pgbackrest.org) by smtp.hostinger.com (smtp.hostinger.com) with ESMTPSA id 4fbSkK0QK5z2xxM; Wed, 18 Mar 2026 12:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgbackrest.org; s=hostingermail1; t=1773836812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fvo/04SjRQIqclt3RB1H+z5qWEI8OX1uWCfYqrrYXLg=; b=FfwquWU6FPuGkdr2IAvROkQlLSNCDwCkHOfwF3G+Y6U22H/ydox+bDXjpvY1MWUF0T8jxZ sB4OIJ0zeHakHx4RNUcybFEM3LKZt1UWM0B+Wvuf5PsmKU83OmVOulUpgNm5rN+2Tp1/X0 JkX2BGeE3zIy+uovimUop2DDFb9DiVe16Lr10rLX2Wiu6+YpjTyZWzxtSkK5vLd0wwlYjE 2aQnnEWTt6PlPolDFLfXQEiwMNVEI5vAaxp7B/znp4Vo1y3qhNHcvbBtcgEgq4s/4lnC9B v5Uw6LauhWpPmAUXUlSrxPAhztV+KuCwV4kEJ8pYXHbnZw37NovPs16m/OazzA== Message-ID: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Return pg_control from pg_backup_stop(). To: Michael Paquier Cc: Haibo Yan , Pg Hackers , Heikki Linnakangas , Robert Haas , Andres Freund , Fujii Masao References: <8b8aa673-fcef-4e14-a05d-0885283ef1b8@pgbackrest.org> <17DC1346-0CDE-4E39-B110-3D6FB0797AC6@gmail.com> <7F7B289B-F94F-42C2-9E54-6A689C0D64BB@gmail.com> <1800c83c-264a-4183-9da5-ac78e25849a8@pgbackrest.org> <3b23e3b7-53d2-4784-b482-05cca3327acb@pgbackrest.org> Content-Language: en-US From: David Steele In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Mar 2026 12:26:48 +0000 (UTC) X-CM-Envelope: MS4xfBheEpqgpsbaXnwa6NfuvbgjgHgnYUl+bEip1IjpQWMwCUW3CHzlnZljFVUAAUqc4Goi52/8NyiSPdfoOoP3HWGWpacgBYFRik9drq4PUuSBGK+n2C6W V6THz1KDE/CWxsBcZpj9lteOyy+0xG4mOGGTeaqWEf2/YZClU2zd74xuDPcfbMT70DLBHyiq28Rt8eSY9InxLpFHTu0jxjpR66xZTs7e8PKQTlSI68q0wEz0 e+uw2su8dszI4umLGRPHQJtepnM+zBkVg01ft+8frBzSxyY+gXCV95XowI+REQcazwQBF7Oex3wC/qxhangWUOit6ikZuVYViUoEEqyb2so4hj0mG/DSfHR3 wi3v36qDij696QKny2OdCfQQcu88JA== X-CM-Analysis: v=2.4 cv=Gq4Q+V1C c=1 sm=1 tr=0 ts=69ba9a0c a=XQ9OyN6yktF38GsZki4d+w==:117 a=XQ9OyN6yktF38GsZki4d+w==:17 a=IkcTkHD0fZMA:10 a=Z2GX7eEtjQV2iX3JZ0sA:9 a=QEXdDO2ut3YA:10 X-AuthUser: david@pgbackrest.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/18/26 15:26, Michael Paquier wrote: > On Wed, Mar 18, 2026 at 07:35:47AM +0000, David Steele wrote: >> You are correct -- the copy of pg_control needs to happen before >> do_pg_backup_stop(). An older version of this patch saved pg_control in >> backup_state which made the prior location safe. However, I missed moving >> this code when I moved pg_control out of backup_state. Code review to the >> rescue. > > Right. I am wondering also if the final result would not be better > without 0002, actually, focusing only on the "simpler" base backup > case through the replication protocol, and you are making a good case > in mentioning it as not absolutely mandatory for base backups that are > taken through the SQL functions. One could always tweak the flag > manually in the control file based on the contents taken from the data > folder. That's more hairy than writing the entire file, for sure, > still possible. Getting even 01 into PG19 would be a great outcome. This would solve the problem of torn pg_control and deleted backup labels for any backups made with pg_basebackup and that's going to cover a *lot* of cases. Established third-party backup solutions that are not based on pg_basebackup are generally able to manipulate pg_control so that's not as much of a concern, perhaps. It does raise the barrier of entry for new backup software if they need to learn to read and validate pg_control to avoid a torn copy and set the flag. Patch 02 solves that problem in a general way so I still think it adds value for the ecosystem -- but we could always discuss that in the PG20 cycle. Whatever gets committed for PG19 I'll write a followup patch to describe the hazards of reading pg_control and generally how to get a good copy. However, this will be complicated enough that the best answer will likely be to use pg_basebackup or some other reputable backup software. I don't love this -- I feel like the low-level interface should be usable with such hazards. Regards, -David