From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_walinspect: fix case where flush LSN is in the middle of a re
Date: Sat, 30 Apr 2022 16:21:33 +0000
Message-ID: <E1nkpqf-001tOJ-EQ@gemulon.postgresql.org> (raw)
pg_walinspect: fix case where flush LSN is in the middle of a record.
Instability in the test for pg_walinspect revealed that
pg_get_wal_records_info_till_end_of_wal(x) would try to decode all the
records with a start LSN earlier than the flush LSN, even though that
might include a partial record at the end of the range. In that case,
read_local_xlog_page_no_wait() would return NULL when it tried to read
past the flush LSN, which would be interpreted as an error by the
caller. That caused a test failure only on a BF animal that had been
restarted recently, but could be expected to happen in the wild quite
easily depending on the alignment of various parameters.
Fix by using private data in read_local_xlog_page_no_wait() to signal
end-of-wal to the caller, so that it can be properly distinguished
from a real error.
Discussion: https://postgr.es/m/Ymd/e5eeZMNAkrXo%40paquier.xyz
Discussion: https://postgr.es/m/111657.1650910309@sss.pgh.pa.us
Authors: Thomas Munro, Bharath Rupireddy.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ed57cac84d1c5642737dab1e4c4b8cb4f0c4305f
Modified Files
--------------
contrib/pg_walinspect/pg_walinspect.c | 59 +++++++++++++++++++---------------
src/backend/access/transam/xlogutils.c | 11 +++++++
src/include/access/xlogutils.h | 6 ++++
3 files changed, 50 insertions(+), 26 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: jdavis@postgresql.org
Subject: Re: pgsql: pg_walinspect: fix case where flush LSN is in the middle of a re
In-Reply-To: <E1nkpqf-001tOJ-EQ@gemulon.postgresql.org>
References: <E1nkpqf-001tOJ-EQ@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox