On Tue, Jan 03, 2023 at 02:53:10PM +0530, Bharath Rupireddy wrote:
> 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.

Well, did you notice 4d894b41?  It introduced this change:

-               readFile = XLogFileReadAnyTLI(readSegNo, DEBUG2, currentSource);
+               readFile = XLogFileReadAnyTLI(readSegNo, DEBUG2,
+                       currentSource == XLOG_FROM_ARCHIVE ? XLOG_FROM_ANY :
+                                        currentSource);

And this patch basically undoes that, meaning that we would basically
look at the archives first for all the expected TLIs, but only if no
files were found in pg_wal/.

The change is subtle, see XLogFileReadAnyTLI().  On HEAD we go through
each timeline listed and check both archives and then pg_wal/ after
the last source that failed was the archives.  The patch does
something different: it checks all the timelines for the archives,
then all the timelines in pg_wal/ with two separate calls to
XLogFileReadAnyTLI().
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to