Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()
Date: 2023-01-05 13:24:18
Message-ID: CALj2ACUCd8Ld8wy9iDkL0h5TWGaZfAyd=BXraRNWLD2Am69Ekw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 4, 2023 at 12:03 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> On Tue, Jan 03, 2023 at 02:53:10PM +0530, Bharath Rupireddy wrote:
> > In summary:
> > the flow when the standby is in crash recovery is pg_wal -> [archive
> > -> pg_wal -> stream] -> [archive -> pg_wal -> stream] -> [] -> [] ...
> > the flow when the standby is in archive recovery is [archive -> pg_wal
> > -> stream] -> [archive -> pg_wal -> stream] -> [] -> [] ...
>
> This is my understanding as well.
>
> > The proposed patch makes the inherent state change to pg_wal after
> > failure to read from archive in XLogFileReadAnyTLI() to explicit by
> > setting currentSource to XLOG_FROM_PG_WAL in the state machine. I
> > think it doesn't alter the existing state machine or add any new extra
> > lookups in pg_wal.
>
> I'm assuming this change would simplify your other patch that modifieѕ
> WaitForWALToBecomeAvailable() [0]. Is that correct?
>
> [0] https://commitfest.postgresql.org/41/3663/

Yes, it does simplify the other feature patch.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gilles Darold 2023-01-05 13:38:58 Re: fix and document CLUSTER privileges
Previous Message Bharath Rupireddy 2023-01-05 13:21:55 Re: Add a new pg_walinspect function to extract FPIs from WAL records