From: 1024 <453539222@qq.com>
To: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: An update deadlock bug
Date: Thu, 23 Mar 2023 16:32:04 +0800
Message-ID: <tencent_639AC1C2CA95490C1CE28F9F9AC74C6BE406@qq.com> (raw)
Hello everyone:
Recently I found a parallel update bugļ¼The steps to recurrence are as follows:
1,create table t1(a int, b varchar(20));
insert into t1 values(generate_series(1,5), 'abc');
2, use pgbench to run parallel update:
pgbench -U postgres -p 5432 postgres -n -r -c 10 -j 1 -T 100 -P 1 -f test.sql
test.sql: update t1 set a = 123 where b = 'abc';
3, We will find "deadlock detected" in log file or terminal.
I want to figure out that if every update use sequence scan ,why deadlock happened?
I look forward to receiving your reply.
Thank you very much!
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: 453539222@qq.com
Subject: Re: An update deadlock bug
In-Reply-To: <tencent_639AC1C2CA95490C1CE28F9F9AC74C6BE406@qq.com>
References: <tencent_639AC1C2CA95490C1CE28F9F9AC74C6BE406@qq.com>
* 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