Re: Regardign RecentFlushPtr in WalSndWaitForWal()

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: Regardign RecentFlushPtr in WalSndWaitForWal()
Date: 2024-03-01 11:10:00
Message-ID: CAEze2Wgm=TvEeDmmyR3pF70k1vhbQFC25fUrV3cRk2HdEECxvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 26 Feb 2024 at 12:46, shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> Hi hackers,
>
> I would like to understand why we have code [1] that retrieves
> RecentFlushPtr in WalSndWaitForWal() outside of the loop. We utilize
> RecentFlushPtr later within the loop, but prior to that, we already
> have [2]. Wouldn't [2] alone be sufficient?
>
> Just to check the impact, I ran 'make check-world' after removing [1],
> and did not see any issue exposed by the test at-least.

Yeah, that seems accurate.

> Any thoughts?
[...]
> [2]:
> /* Update our idea of the currently flushed position. */
> else if (!RecoveryInProgress())

I can't find where this "else" of this "else if" clause came from, as
this piece of code hasn't changed in years. But apart from that, your
observation seems accurate, yes.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2024-03-01 11:19:35 src/include/miscadmin.h outdated comments
Previous Message Thomas Munro 2024-03-01 11:04:32 Re: Volatile write caches on macOS and Windows, redux