From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: pg2401k@pinkwin.com
Subject: BUG #15026: Deadlock using GIST index
Date: Wed, 24 Jan 2018 04:47:06 +0000
Message-ID: <20180124044706.24999.1281@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15026
Logged by: Mark Scheffer
Email address: pg2401k@pinkwin.com
PostgreSQL version: 10.1
Operating system: SLES 12 sp3
Description:
Following (fabricated) example shows there is a path in the GIST code that
leads to deadlocks:
-- Session 1:
DROP TABLE IF EXISTS locked;
CREATE TABLE locked
(
key text NOT NULL,
EXCLUDE USING gist (key WITH =)
);
BEGIN;
INSERT INTO locked(key) values('a');
-- Session 2:
INSERT INTO locked(key) values('a');
--> lock wait
-- Session 3:
INSERT INTO locked(key) values('a');
--> lock wait
-- Session 1:
ROLLBACK;
--> Session 3 generates deadlock:
ERROR: deadlock detected
DETAIL: Process 16079 waits for ShareLock on transaction 1420618256;
blocked by process 8594.
Process 8594 waits for ShareLock on transaction 1420618257; blocked by
process 16079.
HINT: See server log for query details.
CONTEXT: while checking exclusion constraint on tuple (0,2) in relation
"locked"
Note: Replacing the GIST with a unique index does not produce this error.
Note: Setting deadlock_timeout to some high value will help analysis.
Version: 10.1-9.1 from OpenSuse repository
"PostgreSQL 10.1 on x86_64-suse-linux-gnu, compiled by gcc (SUSE Linux)
4.8.5, 64-bit"
Regards,
Mark.
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-bugs@postgresql.org
Cc: noreply@postgresql.org, pg2401k@pinkwin.com
Subject: Re: BUG #15026: Deadlock using GIST index
In-Reply-To: <20180124044706.24999.1281@wrigleys.postgresql.org>
References: <20180124044706.24999.1281@wrigleys.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