Re: on 19beta3: repack (concurrently) affects sessions with transaction isolation level repeatable read

From: Jochen Bandhauer <jb(at)jbitc(dot)de>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: on 19beta3: repack (concurrently) affects sessions with transaction isolation level repeatable read
Date: 2026-08-23 09:31:08
Message-ID: 0865e13a-da93-4ad1-8b93-7b54a1628f04@jbitc.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 22.08.2026 21:45, Peter Geoghegan wrote:
> On Sat, Aug 22, 2026 at 3:29 AM Jochen Bandhauer <jb(at)jbitc(dot)de> wrote:
>> while using repack (concurrently) I found a behavior that I didn't
>> expect. When running a "repack (concurrently) t;" in one session,
>> another session with "transaction isolation level repeatable read"
>> reports sometimes 0 for "select count(*) from t;".
> This is a documented behavior; "repack concurrently" is allowed to
> violate MVCC. There's a warning box about this in the docs for the
> repack command [1], which notes "REPACK with the CONCURRENTLY option
> is not MVCC-safe, see Section 13.6 for details".
>
> [1] https://www.postgresql.org/docs/devel/sql-repack.html
Hello,

thanks, I haven't seen that. I also read that this might change in the
future [1]. After some further reading I applied patch [2] that worked
for the test case (The second session always showed the correct number
of rows).

Jochen

[1]
https://www.postgresql.org/message-id/202504040733.ysuy5gad55md%40alvherre.pgsql
[2] https://commitfest.postgresql.org/patch/6957/

--
Mit freundlichen Grüßen

Jochen Bandhauer
+49 (0)176 29390012
www.jbitc.de

Attachment Content-Type Size
jb.vcf text/vcard 202 bytes

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Zhijie Hou (Fujitsu) 2026-08-23 09:17:33 RE: MERGE/SPLIT PARTITIONS issues/questions