Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding
Дата
Msg-id 202202131526.2n2bcdx2cjse@alvherre.pgsql
обсуждение исходный текст
Ответ на pgsql: Fix skip-empty-xacts with sequences in test_decoding  (Tomas Vondra <tomas.vondra@postgresql.org>)
Ответы Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-committers
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.)

> 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 ...

-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/
"Nadie está tan esclavizado como el que se cree libre no siéndolo" (Goethe)



В списке pgsql-committers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: ci: fix copy-paste mistake in 16eb8231d1b.
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding