Re: [PATCHES] SRA Win32 sync() code

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [PATCHES] SRA Win32 sync() code
Date: 2003-11-16 18:06:48
Message-ID: 200311161806.hAGI6mu11492@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> One reason I like the idea of adopting a sync-when-you-write policy is
> >> that it eliminates the need for anything as messy as that.
>
> > Yes, but can we do it without causing a performance degredation, and I
> > would hate to change something to make things easier on Win32 while
> > penalizing all platforms.
>
> Having to keep a list of modified files in shared memory isn't a penalty?
>
> Seriously though, if we can move the bulk of the writing work into
> background processes then I don't believe that there will be any
> significant penalty for regular backends. And I believe that it would
> be a huge advantage from a correctness point of view if we could stop
> depending on sync(). The fact that Windows hasn't got sync() is merely
> another reason we should stop using it.

If the background writer starts using fsync(), we can have normal
backends that do a write() set a shared memory boolean. We can then
test that boolean and do sync() only if other backends had to do their
own writes.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-11-16 18:15:27 Re: interesting SIGNAL 10 (BUSERR) on CVS
Previous Message Larry Rosenman 2003-11-16 18:01:35 Re: interesting SIGNAL 10 (BUSERR) on CVS

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2003-11-16 18:21:38 Re: [PATCHES] SRA Win32 sync() code
Previous Message Andrew Dunstan 2003-11-16 17:38:52 Re: [PATCHES] SRA Win32 sync() code

Browse pgsql-patches by date

  From Date Subject
Next Message Manfred Spraul 2003-11-16 18:20:14 Re: SIGPIPE handling
Previous Message Bruce Momjian 2003-11-16 18:03:25 Re: SIGPIPE handling