Re: repack: clarify final phase of concurrent mode in file header comment

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: repack: clarify final phase of concurrent mode in file header comment
Date: 2026-11-25 16:41:41
Message-ID: awcPiCgEZuQewlux@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-Apr-16, Chao Li wrote:

> The file header comment in repack.c briefly explains the workflow of concurrent mode as:
>
> 1. Lock the table with ShareUpdateExclusiveLock
> 2. Do an initial copy as non-concurrent mode
> 3. While the initial copy is going on, accumulates concurrent changes to a file
> 4. After the initial copy, read the file and re-apply the changes
> 5. Upgrade to AccessExclusiveLock and swap the relfilenodes
>
> When I read the comment, I got confused at step 4. While that re-apply
> pass is running, concurrent changes can still occur, so what happens
> to those changes?

Somebody independently mentioned this a few days ago, so I have pushed
this patch, thanks.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aidar Imamov 2026-11-25 16:43:54 Re: meson: pass OpenSSL/ICU include dirs to extensions
Previous Message Peter Eisentraut 2026-11-25 16:29:09 Re: new clang warnings about unused global variables