Re: could not link file in wal restore lines - Mailing list pgsql-bugs

From Kyotaro Horiguchi
Subject Re: could not link file in wal restore lines
Date
Msg-id 20220725.172552.1779942765421887643.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: could not link file in wal restore lines  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-bugs
At Mon, 25 Jul 2022 17:11:32 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.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



pgsql-bugs by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: could not link file in wal restore lines
Next
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Excessive number of replication slots for 12->14 logical replication