pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix under-parenthesized XLogRecHasBlockRef() macro.
Date: Tue, 20 Apr 2021 21:02:08 +0000
Message-ID: <E1lYxVY-000553-Lm@gemulon.postgresql.org> (raw)

Fix under-parenthesized XLogRecHasBlockRef() macro.

Commit f003d9f87 left this macro with inadequate (or, one could say,
too much) parenthesization.  Which was catastrophic to the correctness
of calls such as "if (!XLogRecHasBlockRef(record, 1)) ...".  There
are only a few of those, which perhaps explains why we didn't notice
immediately (with our general weakness of WAL replay testing being
another factor).  I found it by debugging intermittent replay failures
like

2021-04-08 14:33:30.191 EDT [29463] PANIC:  failed to locate backup block with ID 1
2021-04-08 14:33:30.191 EDT [29463] CONTEXT:  WAL redo at 0/95D3438 for SPGist/ADD_NODE: off 1; blkref #0: rel 1663/16384/25998, blk 1

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9e41148229192dccc4bcc40f53af588b73d8ffea

Modified Files
--------------
src/include/access/xlogreader.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



Message-ID: <E1lYxVY-000553-Lm@gemulon.postgresql.org>
Permalink:  ../E1lYxVY-000553-Lm@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lYxVY-000553-Lm@gemulon.postgresql.org

 · 

reply

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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix under-parenthesized XLogRecHasBlockRef() macro.
  In-Reply-To: <E1lYxVY-000553-Lm@gemulon.postgresql.org>
  References: <E1lYxVY-000553-Lm@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