From: Michael Paquier <michael@paquier.xyz>
To: Zsolt Ero <zsolt.ero@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: could not link file in wal restore lines
Date: Sat, 23 Jul 2022 12:36:47 +0900
Message-ID: <Yttsz99SeUpyFBD/@paquier.xyz> (raw)
In-Reply-To: <CAKw-smBhLOGtRJTC5c=qKTPz8gz5+WPoVAXrHB6mY-1U4_N7-w@mail.gmail.com>
References: <CAKw-smBhLOGtRJTC5c=qKTPz8gz5+WPoVAXrHB6mY-1U4_N7-w@mail.gmail.com>
On Fri, Jul 22, 2022 at 04:24:54AM -0500, Zsolt Ero wrote:
> I've opened an issue on pgbackrest, where the developer confirmed that
> those files are not touched by pgbackrest, they are basically copied back
> exactly as they were. The backup/restore is on the same partition as the
> data folder, so no chance of file system changes, etc. Single master, no
> replication.
>
> I'm always doing clean data dir + init_db so there is nothing there before
> the restore. I can replicate this behaviour 100%.
>
> PostgreSQL version: psql (PostgreSQL) 12.11 (Ubuntu 12.11-1.pgdg18.04+1)
>
> OS is Ubuntu 18.04
>
> pgbackrest issue: https://github.com/pgbackrest/pgbackrest/issues/1815
>
> log details:
>
> could not link file "pg_wal/000000010000015600000098" to
> "pg_wal/00000001000001570000006E": File exists
FWIW, the backend code has protections to prevent *exactly* this kind
of problems when recycling WAL segment files at checkpoints with a set
of LWLocks taken on the control file, for one. Perhaps you have
messed up things and you have finished in such a state that backrest
writes to pg_wal/ concurrently with a cluster running and running a
checkpoint, which would explain those link() calls to be failing?
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, zsolt.ero@gmail.com
Subject: Re: could not link file in wal restore lines
In-Reply-To: <Yttsz99SeUpyFBD/@paquier.xyz>
References: <CAKw-smBhLOGtRJTC5c=qKTPz8gz5+WPoVAXrHB6mY-1U4_N7-w@mail.gmail.com> <Yttsz99SeUpyFBD/@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox