Re: Write skew observed under serializable isolation

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Write skew observed under serializable isolation
Date: 2026-09-23 21:19:38
Message-ID: CAN4CZFMs1W11eBpvo5bJsGaXoEBKkdcgZiBW9VzWTmGkD3zW5w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> The proper fix is to acquire SIREAD on the relation.

That's a way to fix it, but I am not sure that it is the proper way to
do it because it locks way more than needed.

One issue is that now this takes a whole relation lock for UPDATE ...
WHERE CURRENT OF, which can cause false-positive abort of cursor
loops. I think this part is fixable with an extended condition.

Also after I looked into this a bit more today, cb5b28613d5 in 2020
introduced SO_TYPE_TIDSCAN exactly to prevent full relation locks.
Maybe the reasoning of that commit was wrong, and we indeed need whole
relation locks there, but it doesn't seem like a trivial decision to
me.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-09-23 21:19:50 Re: [PATCH] Use bounded GIN pending-list cleanup in parallel autovacuum
Previous Message Lukas Fittl 2026-09-23 20:26:41 Re: PostgreSQL 19 Beta 4 release announcement draft