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 1nRh5n-00070R-5y for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Mar 2022 21:10:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nRh5k-0001FL-VO for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Mar 2022 21:10:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRh5k-0001FC-LV for pgsql-hackers@lists.postgresql.org; Tue, 08 Mar 2022 21:10:00 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRh5h-0002z4-Vi for pgsql-hackers@lists.postgresql.org; Tue, 08 Mar 2022 21:09:59 +0000 Received: from [10.5.0.2] (unknown [192.145.116.176]) (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 2670F54666; Tue, 8 Mar 2022 21:09:55 +0000 (UTC) Message-ID: Date: Tue, 8 Mar 2022 15:09:50 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file Content-Language: en-US To: Nathan Bossart , Chapman Flack Cc: Stephen Frost , pgsql-hackers@lists.postgresql.org References: <621E4529.1090601@anastigmatix.net> <20220301173208.GB1031413@nathanxps13> <1f685b3a-7ec2-825e-bb2b-d87d78ad5bd9@pgmasters.net> <621E6C2E.2050801@anastigmatix.net> <20220301191441.GW10577@tamriel.snowman.net> <621E7A5C.1030203@anastigmatix.net> <20220301200523.GX10577@tamriel.snowman.net> <20220302010302.GA1182956@nathanxps13> <621FC447.90502@anastigmatix.net> <20220308200107.GA85558@nathanxps13> From: David Steele In-Reply-To: <20220308200107.GA85558@nathanxps13> 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 3/8/22 14:01, Nathan Bossart wrote: > On Wed, Mar 02, 2022 at 02:23:51PM -0500, Chapman Flack wrote: >> I did not notice this earlier (sorry), but there seems to remain in >> backup.sgml a programlisting example that shows a psql invocation >> for pg_backup_start, then a tar command, then another psql invocation >> for pg_backup_stop. >> >> I think that was only workable for the exclusive mode, and now it is >> necessary to issue pg_backup_start and pg_backup_stop in the same session. >> >> (The 'touch backup_in_progress' business seems a bit bogus now too, >> suggesting an exclusivity remembered from bygone days.) >> >> I am not sure what a workable, simple example ought to look like. >> Maybe a single psql script issuing the pg_backup_start and the >> pg_backup_stop, with a tar command in between with \! ? >> >> Several bricks shy of production-ready, but it would give the idea. > > Another option might be to just remove this section. The top of the > section mentions that this is easily done using pg_basebackup with the -X > parameter. The bottom part of the section includes more complicated steps > for when "more flexibility in copying the backup files is needed..." > AFAICT the more complicated strategy was around before pg_basebackup, and > the pg_basebackup recommendation was added in 2012 as part of 920febd. > Thoughts? This makes sense to me. I think pg_basebackup is far preferable to doing anything like what is described in this section. Unless you are planning to do something fancy (parallelization, snapshots, object stores, etc.) then pg_basebackup is the way to go. Regards, -David