Re: fsync with sync, and Win32 unlink - Mailing list pgsql-hackers-win32

From Claudio Natoli
Subject Re: fsync with sync, and Win32 unlink
Date
Msg-id A02DEC4D1073D611BAE8525405FCCE2B55F37B@harris.memetrics.local
Whole thread Raw
List pgsql-hackers-win32
> Hmm ... so you're suggesting that if every open() that can ever open a
> Postgres file is replaced by this win32_open() code, then unlink()ing
> the file will behave as per Unix custom?

AFAICS, this is correct. [Strictly, only those files we may later unlink()
whilst the file remains held open elsewhere, such as those from
BasicOpenFile, but a global replacement of open ala pg/ulink would suffice]


> Presumably, if we miss even one open(), or some random admin is more'ing a
file
> when we try to delete it, the database crashes?

Depending on how the external program open()'d the files, it could lock the
unlink()'ing backend until the program released the offending file handle
(assuming we retain dirmod.c).


> This strikes me as pretty damn fragile, but then every part of Windoze
> is pretty damn fragile.  If it works as you say then it's good enough
> for me, because I'm not ever going to buy into the premise that Postgres
> on Windows is a production-grade setup.

It passes the regression tests, and every other test I've got to throw at
it.

I'll play with it a bit more, and pending any major flaws I'll submit a
patch in the near future.

Cheers,
Claudio

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

pgsql-hackers-win32 by date:

Previous
From: Tom Lane
Date:
Subject: Re: fsync with sync, and Win32 unlink
Next
From: Claudio Natoli
Date:
Subject: Re: fsync with sync, and Win32 unlink