Re: log XLogPrefetch stats at end of recovery

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, Lakshmi N <lakshmin(dot)jhs(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: log XLogPrefetch stats at end of recovery
Date: 2026-11-17 16:24:52
Message-ID: CAE9k0Pnuuai1jYTsKmOYJkGnobmTFcFSgqYRwOBPF628vqstVA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Bharath,

On Thu, Nov 12, 2026 at 2:28 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Thu, Nov 5, 2026 at 11:04 PM Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com> wrote:
> >
> > I have addressed comments 4 and 5 in the attached v5 patch.
>
> Thanks for updating the patch.
>
> > To summarize, v5 adds these:
> >
> > 1) Reports accumulated prefetch statistics at the end of recovery,
> > regardless of whether prefetching is enabled at that point, and
> > includes the current recovery_prefetch setting.
> >
> > 2) Adds regression tests covering zero counters and statistics
> > retained after disabling prefetching.
>
> A TAP test is an overkill here. The code is already covered in the
> recovery tests [1].
>
> > 3) Renames the function to XLogPrefetchLogStatsOnRecoveryEnd() to make
> > its intended use explicit.
> >
> > Please take a look and let me know for any other comments.
>
> I don't think we need to report whether recovery prefetch was on
> during the recovery in the log message (sorry for saying so upthread).
> BTW, even if we were to report it, RecoveryPrefetchEnabled() was the
> correct one to use. But I would drop it.
>
> Please have a look at the attached v6 with the above adjustments:
> moved the log message after the existing "last completed
> transaction..." message, reworded the commit message, and dropped the
> TAP test. I think it is RfC. Thoughts?
>

Thanks for sharing this. I don’t have any major comments, and the
changes look good to me. I’d be happy to wait and hear what others
think.

--
With Regards,
Ashutosh Sharma.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew Mochalkin 2026-11-17 16:37:24 Re: libpq: SCRAM client proofs serialize across threads on OpenSSL 3 (re-init of the HMAC per PBKDF2 iteration)
Previous Message Manu 2026-11-17 15:58:56 Quadratic constraint naming for FKs to partitioned tables