From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Test additional speculative conflict scenarios.
Date: Wed, 12 Feb 2020 00:43:09 +0000
Message-ID: <E1j1g7R-0003yb-LD@gemulon.postgresql.org> (raw)
Test additional speculative conflict scenarios.
Previously, the speculative insert tests did not cover the case when a
tuple t is inserted into a table with a unique index on a column but
before it can insert into the index, a concurrent transaction has
inserted a conflicting value into the index and the insertion of tuple t
must be aborted.
The basic permutation is one session successfully inserts into the table
and an associated unique index while a concurrent session successfully
inserts into the table but discovers a conflict before inserting into
the index and must abort the insertion.
Several variants on this include:
- swap which session is successful
- first session insert transaction does not commit, so second session
must wait on a transaction lock
- first session insert does not "complete", so second session must wait
on a speculative insertion lock
Also, refactor the existing TOAST table upsert test to be in the same
spec and reuse the steps.
Author: Melanie Plageman, Ashwin Agrawal, Andres Freund
Reviewed-by: Andres Freund, Taylor Vesely
Discussion: https://postgr.es/m/CAAKRu_ZRmxy_OEryfY3G8Zp01ouhgw59_-_Cm8n7LzRH5BAvng@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/43e08419708a938236e76cd50de2db512e1c3a0c
Modified Files
--------------
.../expected/insert-conflict-specconflict.out | 277 +++++++++++++++++----
.../isolation/expected/insert-conflict-toast.out | 15 --
src/test/isolation/isolation_schedule | 1 -
.../specs/insert-conflict-specconflict.spec | 140 +++++++++--
.../isolation/specs/insert-conflict-toast.spec | 51 ----
5 files changed, 356 insertions(+), 128 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: andres@anarazel.de
Subject: Re: pgsql: Test additional speculative conflict scenarios.
In-Reply-To: <E1j1g7R-0003yb-LD@gemulon.postgresql.org>
References: <E1j1g7R-0003yb-LD@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