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 1t9dVB-00BPEX-FH for pgsql-admin@arkaria.postgresql.org; Sat, 09 Nov 2024 04:55:12 +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 1t9dV8-00G6G7-SV for pgsql-admin@arkaria.postgresql.org; Sat, 09 Nov 2024 04:55:11 +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.94.2) (envelope-from ) id 1t9dV8-00G6Fz-HH for pgsql-admin@lists.postgresql.org; Sat, 09 Nov 2024 04:55:11 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t9dV3-000xq5-Md for pgsql-admin@lists.postgresql.org; Sat, 09 Nov 2024 04:55:10 +0000 Received: from [172.20.10.7] (unknown [183.74.204.232]) by oss.nttdata.com (Postfix) with ESMTPSA id 5CA4261A5D; Sat, 9 Nov 2024 13:55:00 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Sat, 9 Nov 2024 13:54:54 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Running rsync backups in pg15 To: Murthy Nunna , Pgsql-admin References: <01000193082d1077-34d9461d-49e4-44ef-b83a-0201df4fc0ba-000000@email.amazonses.com> Content-Language: en-US From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024/11/09 1:53, Murthy Nunna wrote: > Yes, I know. Exclusive backups are removed. > > From release notes of 15: > > * Remove long-deprecated *exclusive backup mode*  (David Steele, Nathan Bossart) > > If the database server stops abruptly while in this mode, the server could fail to start. The non-exclusive backup mode is considered superior for all purposes. Functions pg_start_backup()/pg_stop_backup() have been renamed to pg_backup_start()/pg_backup_stop(), and the functions pg_backup_start_time() and pg_is_in_backup() have been removed. > > Sorry my question was not clear. As per above release notes - If the database server stops abruptly while in this mode, the server could fail to start. However, I crash tested in pg14 (stopped abruptly during exclusive backup) but the cluster still started fine. Pg14 renamed backup_label to backup_label.old and restarted the cluster successfully. If the server crashes during backup mode and the WAL files indicated by backup_label as the recovery starting point are removed (due to checkpoints during backup mode), the server won't start. You can reproduce this issue with the following steps, for example. -------------------- initdb -D data pg_ctl -D data start psql -c "select pg_start_backup('test', true)" psql -c "select pg_switch_wal(); checkpoint" psql -c "select pg_switch_wal(); checkpoint" kill -9 $(head -1 data/postmaster.pid) pg_ctl -D data start -------------------- I understand some people still prefer exclusive backups for some reasons, which is why I developed the pg_exclusive_backup extension that provides functions for exclusive backups on PostgreSQL 15 or later. However, since this is an unofficial extension, it's generally better to update your backup method or script to use non-exclusive backups. https://github.com/MasaoFujii/pg_exclusive_backup Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION