Re: last_archived_wal is not necessary the latest WAL file (was Re: pgsql: Add test case for an archive recovery corner case.)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: last_archived_wal is not necessary the latest WAL file (was Re: pgsql: Add test case for an archive recovery corner case.)
Date: 2022-02-15 21:28:27
Message-ID: 3186114.1644960507@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Heikki Linnakangas <hlinnaka(at)iki(dot)fi> writes:
> That was interesting: the order that WAL segments are archived when a
> standby is promoted is not fully deterministic.

Oh, of course.

> I find it a bit surprising that pg_stat_archiver.last_archived_wal is
> not necessarily the highest-numbered segment that was archived. I
> propose that we mention that in the docs, as in the attached patch.

+1, but I think the description of that field in the pg-stat-archiver-view
table is also pretty misleading. Maybe like

- Name of the last WAL file successfully archived
+ Name of the WAL file most recently successfully archived

and similarly s/last/most recent/ for the other fields claiming
to be "last" something.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2022-02-15 21:54:43 pgsql: docs: Work around bug in the docbook xsl stylesheets.
Previous Message Heikki Linnakangas 2022-02-15 21:20:50 last_archived_wal is not necessary the latest WAL file (was Re: pgsql: Add test case for an archive recovery corner case.)

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2022-02-15 21:29:20 Race conditions in 019_replslot_limit.pl
Previous Message Tom Lane 2022-02-15 21:21:23 PGEventProcs must not be allowed to break libpq