Re: fsync with sync, and Win32 unlink

From: Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>
To: 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>
Cc: 'Bruce Momjian' <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: fsync with sync, and Win32 unlink
Date: 2004-03-13 05:07:34
Message-ID: A02DEC4D1073D611BAE8525405FCCE2B55F37B@harris.memetrics.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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>

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Claudio Natoli 2004-03-13 11:26:01 Re: fsync with sync, and Win32 unlink
Previous Message Tom Lane 2004-03-13 03:55:56 Re: fsync with sync, and Win32 unlink