pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: yrshen@stu.xidian.edu.cn
Subject: BUG #18750: Inappropriate update when it is blocked in RC
Date: Mon, 23 Dec 2024 06:13:30 +0000
Message-ID: <18750-e0a79ec68de35cec@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18750
Logged by:          Yiran Shen
Email address:      yrshen@stu.xidian.edu.cn
PostgreSQL version: 17.2
Operating system:   Ubuntu 22.04
Description:        

Note: Tx1 means transaction 1 and Tx2 means transaciton 2. 
The bug case for the concurrent transactions is executed in the following
order.
How to repeat:
-----------------------------------------------------------------------------
/* Tx1 */ BEGIN;
/* Tx1 */ SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
/* Tx2 */ BEGIN;
/* Tx2 */ SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
/* Tx1 */ UPDATE t SET b=3;
/* Tx2 */ UPDATE t SET b=2 WHERE a IS NOT NULL;  
/* Tx1 */ UPDATE t SET a=1;
/* Tx1 */ COMMIT;
/* Tx2 */ COMMIT;
 
/* Tx1 */ SELECT * FROM t; -- actual: [(1, 3), (1 ,2)], expected: [(1, 2),
(1, 2)]
-----------------------------------------------------------------------------
The UPDATE statement of Tx2 was initially blocked by the first UPDATE
statement of Tx1. It recovered after Tx1's COMMIT, but its query result is
incorrect. According to the documentation of PostgreSQL 17, the Transaction
Isolation of the section 13.2 has denoted that the UPDATE statement of Tx2
should attempt to apply its operation to the updated version of the row in
RC if the first updater commits. So I'm wondering if this is a bug in RC
that doesn't meet that isolation level.



view thread (8+ messages)  latest in thread

Message-ID: <18750-e0a79ec68de35cec@postgresql.org>
Permalink:  ../18750-e0a79ec68de35cec@postgresql.org/
Also on:    postgresql.org/message-id/18750-e0a79ec68de35cec@postgresql.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, yrshen@stu.xidian.edu.cn
  Subject: Re: BUG #18750: Inappropriate update when it is blocked in RC
  In-Reply-To: <18750-e0a79ec68de35cec@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