On Wed, Nov 28, 2018 at 6:47 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Is it possible that unlink() on APFS is not atomic? That is, the
> sequence of events is something like
>
> pg_ctl: open("postmaster.pid")
> postmaster: unlink("postmaster.pid")
> pg_ctl: reads file, gets zero bytes
>
> But that idea is in the OS-bug class, which we agree seems unlikely.
I think you might be right.
https://github.com/macdice/unlinktest
--
Thomas Munro
http://www.enterprisedb.com