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 1pmXzI-00026H-6o for pgsql-general@arkaria.postgresql.org; Wed, 12 Apr 2023 10:46:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmXzF-0004pB-VT for pgsql-general@arkaria.postgresql.org; Wed, 12 Apr 2023 10:46:01 +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 1pmXzF-0004p0-Kh for pgsql-general@lists.postgresql.org; Wed, 12 Apr 2023 10:46:01 +0000 Received: from cloud.gatewaynet.com ([185.90.37.94]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pmXzD-002QIS-1G for pgsql-general@lists.postgresql.org; Wed, 12 Apr 2023 10:46:01 +0000 Content-Type: multipart/alternative; boundary="------------uEQFCZlhfrYP0fQTxYFFwoW0" Message-ID: <9f9aaa96-cd32-bbb9-ba15-d8685c9aeb08@cloud.gatewaynet.com> Date: Wed, 12 Apr 2023 13:45:56 +0300 MIME-Version: 1.0 Subject: Re: pg_basebackup / recovery To: pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Achilleas Mantzios - cloud In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------uEQFCZlhfrYP0fQTxYFFwoW0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/12/23 12:32, Fabrice Chapuis wrote: > During recovery process of a self contained backup, how postgres know > to stop reading wal when consistency is reached? Because it knows the full packup info. It will observe the STOP WAL LOCATION: 3BC7/4B000130 (file 0000000200003BC70000004B) inside the backup file  It's a full contained backup because you haven't called with the |-X /|method none|/| , and it doesn't get into standby because you haven't called with |--write-recovery-conf !| |I believe by default it will do what you meant that you want. | --------------uEQFCZlhfrYP0fQTxYFFwoW0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 4/12/23 12:32, Fabrice Chapuis wrote:

During recovery process of a self contained backup, how postgres know to stop reading wal when consistency is reached?


Because it knows the full packup info. It will observe the

STOP WAL LOCATION: 3BC7/4B000130 (file 0000000200003BC70000004B)

inside the backup file

 It's a full contained backup because you haven't called with the -X method none , and it doesn't get into standby because you haven't called with --write-recovery-conf !

I believe by default it will do what you meant that you want.

--------------uEQFCZlhfrYP0fQTxYFFwoW0--