pgsql: Delay recovery mode LOG after reading backup_label and/or checkp

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Delay recovery mode LOG after reading backup_label and/or checkp
Date: 2023-10-30 06:29:29
Message-ID: E1qxLmC-0034DA-RT@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Delay recovery mode LOG after reading backup_label and/or checkpoint record

When beginning recovery, a LOG is displayed by the startup process to
show which recovery mode will be used depending on the .signal file(s)
set in the data folder, like "standby mode", recovery up to a given
target type and value, or archive recovery.

A different patch is under discussion to simplify the startup code by
requiring the presence of recovery.signal and/or standby.signal when a
backup_label file is read. Delaying a bit this LOG ensures that the
correct recovery mode would be reported, and putting it at this position
does not make it lose its value.

While on it, this commit adds a few comments documenting a bit more the
initial recovery steps and their dependencies, and fixes an incorrect
comment format. This introduces no behavior changes.

Extracted from a larger patch by me.

Reviewed-by: David Steele, Bowen Shi
Discussion: https://postgr.es/m/ZArVOMifjzE7f8W7@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dc5bd38894373e6806289e3aca26e7fafa5f6f95

Modified Files
--------------
src/backend/access/transam/xlogrecovery.c | 73 ++++++++++++++++++-------------
1 file changed, 42 insertions(+), 31 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2023-10-30 07:15:43 Re: pgsql: doc: comment wording improvement
Previous Message Amit Kapila 2023-10-30 05:26:50 pgsql: Doc: Make link names consistent in logical replication commands.