Re: Adding a test for speculative insert abort case

Melanie Plageman <melanieplageman@gmail.com>

From: Melanie Plageman <melanieplageman@gmail.com>
To: Ashwin Agrawal <aagrawal@pivotal.io>
Cc: Andres Freund <andres@anarazel.de>, Pg Hackers <pgsql-hackers@postgresql.org>, Peter Geoghegan <pg@bowt.ie>
Date: 2019-05-16T20:59:47Z
Lists: pgsql-hackers

Attachments

On Wed, May 15, 2019 at 10:32 PM Ashwin Agrawal <aagrawal@pivotal.io> wrote:

>
> The second index would help to hold the session after inserting the tuple
> in unique index but before completing the speculative insert. Hence, helps
> to create the condition easily. I believe order of index insertion is
> helping here that unique index is inserted and then non-unique index is
> inserted too.
>
>
Oh, cool. I didn't know that execution order would be guaranteed for which
index
to insert into first.


> Attaching patch with the test using the idea Andres mentioned and it works
> to excercise the speculative wait.
>
>
It looks good.
I thought it would be helpful to mention why you have s1 create the
non-unique
index after the permutation has begun. You don't want this index to
influence
the behavior of the other permutations--this part makes sense. However, why
have
s1 do it instead of the controller?

I added a couple suggested changes to the comments in the permutation in the
version in the patch I attached. Note that I did not update the answer
files.
(These suggested changes to comments are in distinct from and would be in
addition to the suggestions I had for the wording of the comments overall
in the
above email I sent).

-- 
Melanie Plageman

Commits

  1. Test additional speculative conflict scenarios.

  2. Add isolation test for INSERT ON CONFLICT speculative insertion failure.