Re: [PATCH] Fix minRecoveryPoint not advanced past checkpoint in CreateRestartPoint - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] Fix minRecoveryPoint not advanced past checkpoint in CreateRestartPoint
Date
Msg-id adXAXO2qASwOHaQ0@paquier.xyz
Whole thread Raw
In response to Re: [PATCH] Fix minRecoveryPoint not advanced past checkpoint in CreateRestartPoint  (Adam Lee <adam8157@gmail.com>)
Responses Re: [PATCH] Fix minRecoveryPoint not advanced past checkpoint in CreateRestartPoint
List pgsql-hackers
On Fri, Apr 03, 2026 at 01:10:08PM +0800, Adam Lee wrote:
> PATCH v2 removed the variable lastCheckPointEndPtr and refined the comments.
>
> Thanks for reviewing.

TBH, I am not convinced that this optimization in the control file is
worth it.  minRecoveryPoint refers to a state where the on-disk pages
are all consistent based on their stored LSNs, see also the
cross-check that we do at the end of recovery in the event of
inconsistent pages.  In most cases (say in the 99%-ish range), we will
have page flushes, making it non-relevant.

With time, I have also learnt the hard way that the less code paths
that update minRecoveryPoint in the control file, as well as the local
copies, the better.  Simplifying this code is something we should try
to work on.  Complicating it more has less value.

If we decide that this optimization is worth having, I am going to
request a TAP test to validate the behavior you'd expect out of it.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: doc: Improve wal_level and effective_wal_level GUC around logical replication
Next
From: Thomas Munro
Date:
Subject: Re: Automatically sizing the IO worker pool