Re: Race between datachecksum enablement and create table with the file_copy strategy

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Race between datachecksum enablement and create table with the file_copy strategy
Date: 2026-07-27 17:36:06
Message-ID: 5E9DEC19-7769-4493-BC87-BA311D2835CE@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On 21 Jul 2026, at 20:35, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>> On 21 Jul 2026, at 12:55, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:

>> There's a small race window between enabling data checksums and
>> creating a new database with the file_copy strategy:
>>
>> Create database checks for in progress data checksums before it
>> inserts a new row into pg_database. If the data checksum worker starts
>> in that window, it can miss the new database completely and skip
>> generating its checksums.
>
> Thanks for the report and patch, I am currently out of the office but will check and apply on Sunday or Monday when back home.

I had a look at this today and came up with the attached v2. Apart from some
comment changes the main difference is that I placed the test in an already
existing testfile to reduce the number of initdb's required, and added a test
for the error message in the logfile.

--
Daniel Gustafsson

Attachment Content-Type Size
v2-0001-Recheck-checksum-state-before-file_copy-during-CR.patch application/octet-stream 6.4 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pritt Balagopal 2026-07-27 17:47:13 Re: BUG #19562: pgcli packaged by the PostgreSQL Yum Repository:ModuleNotFoundError: No module named 'pgspecial'
Previous Message PG Bug reporting form 2026-07-27 16:18:59 BUG #19582: Query fails on mixed IPv4 IPv6 data when index added