Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] SRA Win32 sync() code

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,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 20:00:24
Message-ID: 3FB7D758.20608@Yahoo.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Tom Lane wrote:

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> Tom Lane wrote:
>>> 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.
> 
>> 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.
> 
> That seems like the worst of both worlds --- you still are depending on
> sync() for correctness.
> 
> Also, as long as backends only *seldom* do writes, making them fsync a
> write when they do make one will be less of an impact on overall system
> performance than having a sync() ensue shortly afterwards.  I think you
> are focusing too narrowly on the idea that backends shouldn't ever wait
> for writes, and failing to see the bigger picture.  What we need to
> optimize is overall system performance, not an arbitrary restriction
> that certain processes never wait for certain things.

Removing sync() entirely requires very accurate fsync()'ing in the 
background writer, the checkpointer and the backends. Basically none of 
them can mark a block "clean" if he fails to fsync() the relation later! 
This will be a mess to code.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck(at)Yahoo(dot)com #


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2003-11-16 20:17:08
Subject: Re: [PATCHES] SRA Win32 sync() code
Previous:From: Tom LaneDate: 2003-11-16 18:21:38
Subject: Re: [PATCHES] SRA Win32 sync() code

pgsql-patches by date

Next:From: Tom LaneDate: 2003-11-16 20:17:08
Subject: Re: [PATCHES] SRA Win32 sync() code
Previous:From: Tom LaneDate: 2003-11-16 18:30:24
Subject: Re: SIGPIPE handling

pgsql-hackers-win32 by date

Next:From: Tom LaneDate: 2003-11-16 20:17:08
Subject: Re: [PATCHES] SRA Win32 sync() code
Previous:From: Tom LaneDate: 2003-11-16 18:21:38
Subject: Re: [PATCHES] SRA Win32 sync() code

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group