pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tomas Vondra <tomas.vondra@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding
Date: Sun, 13 Feb 2022 18:08:26 +0100
Message-ID: <3dd2a8ed-f757-5c22-7a0a-91b0b4f11174@enterprisedb.com> (raw)
In-Reply-To: <202202131526.2n2bcdx2cjse@alvherre.pgsql>
References: <202202131526.2n2bcdx2cjse@alvherre.pgsql>



On 2/13/22 16:26, Alvaro Herrera wrote:
> On 2022-Feb-12, Tomas Vondra wrote:
> 
>> 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.
> 
> I think you meant "... need to use skip-empty-xacts = true", since you
> changed the value from 0 to 1, and the point is precisely to *skip*
> those transactions.  (The hidden double negative "skip=false" seems
> quite confusing BTW.)
> 

Yeah, that's what I meant :-(

>> 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.
> 
> Hmm.  Perhaps there should be a separate test script that runs various
> things under skip-empty-xacts=0 and somehow protected against ancillary
> activities (maybe a TAP test using autovacuum=0), just so that this new
> code is covered ...
> 

I'm not sure what exactly would be the benefit? I mean, it'd be testing
exactly the same thing as now - actually less than now, because instead
of ignoring empty transactions in the last step (output plugin), we'd
make sure not to have any empty transactions.

For the record, the new code in sequence decoding is tested already, at
least for transactional increments.

regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (6+ messages)  latest in thread

Message-ID: <3dd2a8ed-f757-5c22-7a0a-91b0b4f11174@enterprisedb.com>
Permalink:  ../3dd2a8ed-f757-5c22-7a0a-91b0b4f11174@enterprisedb.com/
Also on:    postgresql.org/message-id/3dd2a8ed-f757-5c22-7a0a-91b0b4f11174@enterprisedb.com

 · 

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@enterprisedb.com, alvherre@alvh.no-ip.org, tomas.vondra@postgresql.org
  Subject: Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding
  In-Reply-To: <3dd2a8ed-f757-5c22-7a0a-91b0b4f11174@enterprisedb.com>
  References: <202202131526.2n2bcdx2cjse@alvherre.pgsql> <3dd2a8ed-f757-5c22-7a0a-91b0b4f11174@enterprisedb.com>

* 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