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

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(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-03 18:33:24
Message-ID: 20230103183324.GD204418@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-01-03 18:33:34 Re: enable_timeout_every() and fin_time
Previous Message Vik Fearing 2023-01-03 18:32:58 Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions