From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support testing of cases where table schemas change after planni
Date: Fri, 07 Aug 2020 18:31:17 +0000
Message-ID: <E1k479B-0003Xo-BD@gemulon.postgresql.org> (raw)
Support testing of cases where table schemas change after planning.
We have various cases where we allow DDL on tables to be performed with
less than full AccessExclusiveLock. This requires concurrent queries
to be able to cope with the DDL change mid-flight, but up to now we had
no repeatable way to test such cases. To improve that, invent a test
module that allows halting a backend after planning and then resuming
execution once we've done desired actions in another session. (The same
approach could be used to inject delays in other places, if there's a
suitable hook available.)
This commit includes a single test case, which is meant to exercise the
previously-untestable ExecCreatePartitionPruneState code repaired by
commit 7a980dfc6. We'd probably not bother with this if that were the
only foreseen benefit, but I expect additional test cases will use this
infrastructure in the future.
Test module by Andy Fan, partition-addition test case by me.
Discussion: https://postgr.es/m/20200802181131.GA27754@telsasoft.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6f0b632f083ba08fabb6c496caf733802cee9d2e
Modified Files
--------------
src/test/modules/Makefile | 1 +
src/test/modules/delay_execution/.gitignore | 3 +
src/test/modules/delay_execution/Makefile | 21 +++++
src/test/modules/delay_execution/delay_execution.c | 104 +++++++++++++++++++++
.../expected/partition-addition.out | 21 +++++
.../delay_execution/specs/partition-addition.spec | 38 ++++++++
6 files changed, 188 insertions(+)
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: Support testing of cases where table schemas change after planni
In-Reply-To: <E1k479B-0003Xo-BD@gemulon.postgresql.org>
References: <E1k479B-0003Xo-BD@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