Re: BUG #2712: could not fsync segment: Permission - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2712: could not fsync segment: Permission
Date
Msg-id 27575.1163018193@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #2712: could not fsync segment: Permission  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
I wrote:
> It might be interesting to think about not requiring the ControlFileLock
> to be held while making new WAL segments.  I think the only reason it
> does that is to ensure that link/rename failure can be treated as a hard
> error (because no one could have beat us to the filename), but we're
> already having to back off that stance for Windows ...

Just for the archives: I looked into doing this, and realized that the
reason we use a lock here is that on platforms without working link()
we use rename() to emplace new WAL segments.  And rename() is defined
to unlink any existing file of the target name, which would be
completely unsafe to do.

On platforms with link() we could probably get away without a lock,
but I'm disinclined to introduce that much of a platform-specific
difference in behavior when we don't have to.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "JEAN-PIERRE PELLETIER"
Date:
Subject: Re: ERROR: failed to build any 4-way joins SQL state: XX000, PostgreSQL
Next
From: "David Green"
Date:
Subject: JDBC driver bug PreparedStatement.setNull(int,Types.BOOLEAN)