pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix assert failures in parallel SERIALIZABLE READ ONLY.
Date: Mon, 06 Mar 2023 03:50:34 +0000
Message-ID: <E1pZ1ru-0027xJ-CE@gemulon.postgresql.org> (raw)

Fix assert failures in parallel SERIALIZABLE READ ONLY.

1.  Make sure that we don't decrement SxactGlobalXminCount twice when
the SXACT_FLAG_RO_SAFE optimization is reached in a parallel query.
This could trigger a sanity check failure in assert builds.  Non-assert
builds recompute the count in SetNewSxactGlobalXmin(), so the problem
was hidden, explaining the lack of field reports.  Add a new isolation
test to exercise that case.

2.  Remove an assertion that the DOOMED flag can't be set on a partially
released SERIALIZABLEXACT.  Instead, ignore the flag (our transaction
was already determined to be read-only safe, and DOOMED is in fact set
during partial release, and there was already an assertion that it
wasn't set sooner).  Improve an existing isolation test so that it
reaches that case (previously it wasn't quite testing what it was
supposed to be testing; see discussion).

Back-patch to 12.  Bug #17116.  Defects in commit 47a338cf.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/17116-d6ca217acc180e30%40postgresql.org

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/storage/lmgr/predicate.c               | 20 ++++-
.../isolation/expected/serializable-parallel-2.out | 57 ++++---------
.../isolation/expected/serializable-parallel-3.out | 97 ++++++++++++++++++++++
src/test/isolation/isolation_schedule              |  1 +
.../isolation/specs/serializable-parallel-2.spec   | 12 ++-
.../isolation/specs/serializable-parallel-3.spec   | 47 +++++++++++
6 files changed, 184 insertions(+), 50 deletions(-)



view thread (5+ messages)

Message-ID: <E1pZ1ru-0027xJ-CE@gemulon.postgresql.org>
Permalink:  ../E1pZ1ru-0027xJ-CE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pZ1ru-0027xJ-CE@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: tmunro@postgresql.org
  Subject: Re: pgsql: Fix assert failures in parallel SERIALIZABLE READ ONLY.
  In-Reply-To: <E1pZ1ru-0027xJ-CE@gemulon.postgresql.org>
  References: <E1pZ1ru-0027xJ-CE@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