Re: ERROR: tuple to be updated was already modified by an operation triggered by the current command - Mailing list pgsql-bugs

From Robins Tharakan
Subject Re: ERROR: tuple to be updated was already modified by an operation triggered by the current command
Date
Msg-id CAEP4nAy1BT52u=yf+GKGgbDMAR3re6mM992DXaaoaZq1XQ5a1Q@mail.gmail.com
Whole thread Raw
Responses Re: ERROR: tuple to be updated was already modified by an operation triggered by the current command
List pgsql-bugs
Hi,

On Thu, 23 Jan 2025 at 19:42, Richard Guo <guofenglinux@gmail.com> wrote:
>
> I came across $SUBJECT, which can be reproduced using the queries
> below.

I also stepped a few times on this the past few days. Here's a smaller repro:

$ grep -l -B100 "tuple to be updated was already modified by an operation triggered by the current command" */source | xargs -i grep Assertion {}
--java.lang.AssertionError: ANALYZE;
--java.lang.AssertionError: ANALYZE( SKIP_LOCKED);
--java.lang.AssertionError: ANALYZE;
--java.lang.AssertionError: ANALYZE( VERBOSE);
--java.lang.AssertionError: ANALYZE( VERBOSE);


Repro SQL
=========
CREATE TEMPORARY TABLE a(b boolean , UNIQUE(b)) ON COMMIT DELETE ROWS ;
CREATE TEMP TABLE d() INHERITS(a) ON COMMIT DROP ;
ANALYSE;


SQL Output
==========
$ psql postgres -f a.sql
CREATE TABLE
CREATE TABLE
psql:a.sql:6: ERROR:  tuple to be updated was already modified by an operation triggered by the current command


 
>
> This error happens in heap_inplace_lock(), and git-bisect says the
> first bad commit is:
>
> a07e03fd8fa7daf4d1356f7cb501ffe784ea6257 is the first bad commit

 
I also arrived at the same commit.

Checking (914ea1c93c0~0) - 914ea1c93c - fail (1)
Checking (914ea1c93c0~10) - d89335eea6 - fail (1)
Checking (914ea1c93c0~30) - b0a4c3e88b - fail (1)
Checking (914ea1c93c0~70) - 57dec20fd4 - fail (1)
.
.
Checking (914ea1c93c0~1688) - a07e03fd8f - fail (1)
Checking (914ea1c93c0~1689) - dbf3f974ee - pass (0)
Surfacing Commit is a07e03fd8fa7daf4d1356f7cb501ffe784ea6257


Found using SQLancer / creduce.
-
robins
https://robins.in

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #18889: /src/backend/utils/adt/network.c condition is always false
Next
From: Noah Misch
Date:
Subject: Re: ERROR: tuple to be updated was already modified by an operation triggered by the current command