Re: could not link file in wal restore lines

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: zsolt(dot)ero(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: could not link file in wal restore lines
Date: 2022-07-25 08:25:52
Message-ID: 20220725.172552.1779942765421887643.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

At Mon, 25 Jul 2022 17:11:32 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> 2022-07-25 17:05:57.790 JST [151762] LOG: could not link file "pg_wal/000000010000000000000002" to "pg_wal/000000010000000000000059": File exists

(Sorry for the broken mail..)

So, this is the race condition between InstallXLogFileSegment and
KeepFileRestoredFromArchive.

We can insert locking on ControlFileLock in the latter to arbitrate
the race condition, but I think it would be better that the
checkpointer gives up renaming believing the file has been added by
recovery, with adding some prerequisites, or confirming recovered
files.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2022-07-25 09:48:04 RE: Excessive number of replication slots for 12->14 logical replication
Previous Message Kyotaro Horiguchi 2022-07-25 08:11:32 Re: could not link file in wal restore lines