Re: Adding a test for speculative insert abort case

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Melanie Plageman <melanieplageman@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-05-01T01:43:08Z
Lists: pgsql-hackers
On Tue, Apr 30, 2019 at 5:16 PM Melanie Plageman
<melanieplageman@gmail.com> wrote:
> Can anyone think of a good way to put this codepath under test?

During the initial development of ON CONFLICT, speculative insertion
itself was tested using custom stress testing that you can still get
here:

https://github.com/petergeoghegan/jjanes_upsert

I'm not sure that this is something that you can adopt, but I
certainly found it very useful at the time. It tests whether or not
there is agreement among concurrent speculative inserters, and whether
or not there are "unprincipled deadlocks" (user hostile deadlocks that
cannot be fixed by reordering something in application code).

-- 
Peter Geoghegan



Commits

  1. Test additional speculative conflict scenarios.

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