Re: fix pg_mkdir_p to tolerate concurrent directory creation - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: fix pg_mkdir_p to tolerate concurrent directory creation
Date
Msg-id 27f45133-4a6f-45f1-8937-bda963029462@dunslane.net
Whole thread
In response to Re: fix pg_mkdir_p to tolerate concurrent directory creation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: fix pg_mkdir_p to tolerate concurrent directory creation
List pgsql-hackers
On 2026-06-19 Fr 11:07 AM, Tom Lane wrote:
> Actually ... given this change, why don't we drop the initial stat()
> call?  Just try mkdir(), and move on if it succeeds.  If not, but
> there's already a directory there, we're good.  That eliminates the
> race condition without duplicating code.


LGTM, thanks!


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Dmitry Dolgov
Date:
Subject: Re: File locks for data directory lockfile in the context of Linux namespaces
Next
From: "David G. Johnston"
Date:
Subject: Re: Fix \crosstabview to honor \pset display_true/display_false