An update deadlock bug

From: 1024 <453539222(at)qq(dot)com>
To: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: An update deadlock bug
Date: 2023-03-23 08:32:04
Message-ID: tencent_639AC1C2CA95490C1CE28F9F9AC74C6BE406@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello everyone:

Recently I found a parallel update bug,The steps to recurrence&nbsp;are as follows:
1,create table t1(a int, b varchar(20));
&nbsp; &nbsp;insert into t1 values(generate_series(1,5), 'abc');
2, use pgbench to run parallel update:
&nbsp; &nbsp; pgbench -U postgres -p 5432 postgres -n -r -c 10 -j 1 -T 100 -P 1 -f test.sql

&nbsp; &nbsp; test.sql:&nbsp; 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!

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2023-03-23 09:42:57 Re: BUG #17863: Unable to restore dump 12.12 -> 15.2
Previous Message John Naylor 2023-03-23 06:09:44 Re: operator class "xxx" does not exist for access method "yyy"