Re: Failure with 004_logrotate in prairiedog

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: michael(at)paquier(dot)xyz, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Failure with 004_logrotate in prairiedog
Date: 2021-07-20 04:12:21
Message-ID: 20210720.131221.241995309583559010.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Mon, 19 Jul 2021 10:23:46 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in
> Michael Paquier <michael(at)paquier(dot)xyz> writes:
> > On Mon, Jul 19, 2021 at 04:15:36PM +0900, Kyotaro Horiguchi wrote:
> >> When rotation happens, the metainfo file is once removed then
> >> created. If slurp_file in the metafile-checking loop hits the gap, the
> >> slurp_file fails with ENOENT.
>
> > I can read the following code, as of update_metainfo_datafile():
> > if (rename(LOG_METAINFO_DATAFILE_TMP, LOG_METAINFO_DATAFILE) != 0)
>
> Yeah, ignore my previous message. There is an unlink up at the top
> of the function, which fooled me in my caffeine-deprived state.

Yeah, sorry for the stupidity.

> But that path is only taken when logging was just turned off, so
> we must remove the now-irrelevant metafile.

I'm not sure this is relevant, I found the following article. (as a
token of my apology:p)

http://www.weirdnet.nl/apple/rename.html

> There is an easy way to empirically prove that rename() is not
> atomic on Leopard 10.5.2. All you have to do is create a link to a
> directory, replace that link with a

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-07-20 04:14:19 Re: Have I found an interval arithmetic bug?
Previous Message Peter Smith 2021-07-20 04:02:02 Re: [HACKERS] logical decoding of two-phase transactions