From: Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pg_basebackup / recovery
Date: Thu, 13 Apr 2023 07:06:50 +0300
Message-ID: <2042b36e-264c-8d54-615b-b3c00c1a042e@cloud.gatewaynet.com> (raw)
In-Reply-To: <ZDcxNm2xrXHVPybo@paquier.xyz>
References: <CAA5-nLBiTp2xj9A2LOg4pYFjBhY7UyN7ACBo2RDA0=k=BQyPWg@mail.gmail.com>
<9f9aaa96-cd32-bbb9-ba15-d8685c9aeb08@cloud.gatewaynet.com>
<ZDcxNm2xrXHVPybo@paquier.xyz>
Στις 13/4/23 01:31, ο/η Michael Paquier έγραψε:
> On Wed, Apr 12, 2023 at 01:45:56PM +0300, Achilleas Mantzios - cloud wrote:
>> 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
> There is a bit more to that in the recovery logic, depending mostly
> on the presence of backup_ label file in the data folder when recovery
> begins. Once the backup_label is found at the beginning of recovery,
> its information is stored in the control file and the file is renamed
> to backup_label.old hence stopping the server when recovery has not
> reached its expected point would rely on the control file contents
> later on. Then, the startup process and its WAL redo makes sure that
> WAL replays until it finds the WAL record marking the end of the
> backup. Grepping for XLOG_BACKUP_END (WAL record type in this case)
> shows all the areas that rely on that, and xlogrecovery.c covers the
> most relevant bits.
Thank you for the info!
Sorry about my stupid typo "packup" :(
> --
> Michael
--
Achilleas Mantzios
IT DEV - HEAD
IT DEPT
Dynacom Tankers Mgmt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: a.mantzios@cloud.gatewaynet.com, michael@paquier.xyz
Subject: Re: pg_basebackup / recovery
In-Reply-To: <2042b36e-264c-8d54-615b-b3c00c1a042e@cloud.gatewaynet.com>
References: <CAA5-nLBiTp2xj9A2LOg4pYFjBhY7UyN7ACBo2RDA0=k=BQyPWg@mail.gmail.com> <9f9aaa96-cd32-bbb9-ba15-d8685c9aeb08@cloud.gatewaynet.com> <ZDcxNm2xrXHVPybo@paquier.xyz> <2042b36e-264c-8d54-615b-b3c00c1a042e@cloud.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox