From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY.
Date: Thu, 28 Oct 2021 15:45:35 +0000
Message-ID: <E1mg7ax-0000QB-3Q@gemulon.postgresql.org> (raw)
Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY.
Commits fdd965d07 and 3cd9c3b92 tested CREATE INDEX CONCURRENTLY by
launching two separate pgbench runs concurrently. This was needed so
that only a single client thread would run CREATE INDEX CONCURRENTLY,
avoiding deadlock between two CICs. However, there's a better way,
which is to use an advisory lock to prevent concurrent CICs. That's
better in part because the test code is shorter and more readable, but
mostly because it automatically scales things to launch an appropriate
number of CICs relative to the number of INSERT transactions.
As committed, typically half to three-quarters of the CIC transactions
were pointless because the INSERT transactions had already stopped.
In passing, remove background_pgbench, which was added to support
these tests and isn't needed anymore. We can always put it back
if we find a use for it later.
Back-patch to v12; older pgbench versions lack the
conditional-execution features needed for this method.
Tom Lane and Andrey Borodin
Discussion: https://postgr.es/m/139687.1635277318@sss.pgh.pa.us
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/141cd0ef0b0b462a8c6e1ee5ae29c7ae4221b90e
Modified Files
--------------
contrib/amcheck/t/002_cic.pl | 48 +++++++++++++-----------------------
contrib/amcheck/t/003_cic_2pc.pl | 53 ++++++++++++++++++----------------------
src/test/perl/PostgresNode.pm | 49 -------------------------------------
3 files changed, 41 insertions(+), 109 deletions(-)
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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY.
In-Reply-To: <E1mg7ax-0000QB-3Q@gemulon.postgresql.org>
References: <E1mg7ax-0000QB-3Q@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