]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix assert failures in parallel SERIALIZABLE READ ONLY.
authorThomas Munro <tmunro@postgresql.org>
Mon, 6 Mar 2023 02:07:15 +0000 (15:07 +1300)
committerThomas Munro <tmunro@postgresql.org>
Mon, 6 Mar 2023 03:41:34 +0000 (16:41 +1300)
commitafa122e41c651edfaa17b47652025ea48085eb94
tree098a8ee20b0b0df394878ec6085d1952032ba2d3
parentb162660d3ac44688f18919cd460423022e467512
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
src/backend/storage/lmgr/predicate.c
src/test/isolation/expected/serializable-parallel-2.out
src/test/isolation/expected/serializable-parallel-3.out [new file with mode: 0644]
src/test/isolation/isolation_schedule
src/test/isolation/specs/serializable-parallel-2.spec
src/test/isolation/specs/serializable-parallel-3.spec [new file with mode: 0644]