Re: Possible race condition in pg_basebackup - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: Possible race condition in pg_basebackup
Date
Msg-id 2A5B29E9-658D-4AD7-8879-C6169D1327E3@yandex-team.ru
Whole thread
In response to Re: Possible race condition in pg_basebackup  (Andrey Borodin <x4mmm@yandex-team.ru>)
Responses Re: Possible race condition in pg_basebackup
Re: Possible race condition in pg_basebackup
List pgsql-hackers
Hi Nick,

On 11 Sep 2026, Nick Ivanov wrote:
> I agree, and I'm attaching a separate patch for that.

Thanks!  This looks like the right scope for a backpatch.

I adapted your v2 test for the client-side fix, checking that the slot
already reserves WAL before the server sends the startpoint.  It covers
both --create-slot and the default temporary slot, and requires the
backup to succeed after the concurrent checkpoint.  Without the fix,
both cases fail with the expected missing-WAL error.

Small wording detail. Another checkpoint is enough to trigger the race.
It need not come from another basebackup.  I adjusted and wrapped the
commit message accordingly.  Apart from wrapping a comment, the client
code is unchanged.

WDYT?


Best regards, Andrey Borodin.

Attachment

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: Return pg_control from pg_backup_stop().
Next
From: Robert Treat
Date:
Subject: Re: REPACK (CONCURRENTLY) doesn't handle invalid indexes