pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix skip-empty-xacts with sequences in test_decoding
Date: Sat, 12 Feb 2022 23:00:03 +0000
Message-ID: <E1nJ1N5-0000S4-UE@gemulon.postgresql.org> (raw)

Fix skip-empty-xacts with sequences in test_decoding

Regression tests need to use skip-empty-xacts = false, because there
might be accidental concurrent activity (like autovacuum), particularly
on slow machines. The tests added by 80901b3291 failed to do that in a
couple places, triggering occasional failures on buildfarm.

Fixing the tests however uncovered a bug in the code, because sequence
callbacks did not handle skip-empty-xacts properly. For trasactional
increments we need to check/update the xact_wrote_changes flag, and emit
the BEGIN if it's the first change in the transaction.

Reported-by: Andres Freund
Discussion: https://postgr.es/m/20220212220413.b25amklo7t4xb7ni%40alap3.anarazel.de

Branch
------
master

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

Modified Files
--------------
contrib/test_decoding/expected/sequence.out | 12 +++++-------
contrib/test_decoding/sql/sequence.sql      |  8 ++++----
contrib/test_decoding/test_decoding.c       | 22 ++++++++++++++++++++++
3 files changed, 31 insertions(+), 11 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1nJ1N5-0000S4-UE@gemulon.postgresql.org>
Permalink:  ../E1nJ1N5-0000S4-UE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nJ1N5-0000S4-UE@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: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding
  In-Reply-To: <E1nJ1N5-0000S4-UE@gemulon.postgresql.org>
  References: <E1nJ1N5-0000S4-UE@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