pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix nbtree kill_prior_tuple posting list assert.
Date: Mon, 06 Apr 2020 21:47:00 +0000
Message-ID: <E1jLZa8-0001IK-OK@gemulon.postgresql.org> (raw)

Fix nbtree kill_prior_tuple posting list assert.

An assertion added by commit 0d861bbb checked that _bt_killitems() only
processes a BTScanPosItem whose heap TID is contained in a posting list
tuple when its page offset number still matches what is on the page
(i.e. when it matches the posting list tuple's current offset number).
This was only correct in the common case where the page can't have
changed since we first read it.  It was not correct in cases where we
don't drop the buffer pin (and don't need to verify the page hasn't
changed using its LSN).  The latter category includes scans involving
unlogged tables, and scans that use a non-MVCC snapshot, per the logic
originally introduced by commit 2ed5b87f.

The assertion still seems helpful.  Fix it by taking cases where the
page may have been concurrently modified into account.

Reported-By: Anastasia Lubennikova, Alexander Lakhin
Discussion: https://postgr.es/m/c4e38e9a-0f9c-8e53-e639-adf343f94472@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ce2cee0ade8a6a360322c51201fda1fc25be7773

Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)



Message-ID: <E1jLZa8-0001IK-OK@gemulon.postgresql.org>
Permalink:  ../E1jLZa8-0001IK-OK@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jLZa8-0001IK-OK@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: pg@bowt.ie
  Subject: Re: pgsql: Fix nbtree kill_prior_tuple posting list assert.
  In-Reply-To: <E1jLZa8-0001IK-OK@gemulon.postgresql.org>
  References: <E1jLZa8-0001IK-OK@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