Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nK5NQ-0002On-0Y for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Feb 2022 21:28:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nK5NO-0006Yx-7W for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Feb 2022 21:28:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nK5NN-0006Yo-Uq for pgsql-hackers@lists.postgresql.org; Tue, 15 Feb 2022 21:28:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nK5NH-0003re-JF for pgsql-hackers@postgresql.org; Tue, 15 Feb 2022 21:28:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 21FLSRmm3186115; Tue, 15 Feb 2022 16:28:27 -0500 From: Tom Lane To: Heikki Linnakangas cc: pgsql-hackers Subject: Re: last_archived_wal is not necessary the latest WAL file (was Re: pgsql: Add test case for an archive recovery corner case.) In-reply-to: <831b6ab9-45d6-7ab0-ea9c-6efd4383afb8@iki.fi> References: <2842251.1644849700@sss.pgh.pa.us> <8f15e602-337e-fbb2-4b2e-e83a01ef9088@iki.fi> <831b6ab9-45d6-7ab0-ea9c-6efd4383afb8@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Tue, 15 Feb 2022 23:20:50 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3186113.1644960507.1@sss.pgh.pa.us> Date: Tue, 15 Feb 2022 16:28:27 -0500 Message-ID: <3186114.1644960507@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Heikki Linnakangas 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