Re: [HACKERS] Problem with the numbers I reported yesterday - Mailing list pgsql-hackers

From ocie@paracel.com
Subject Re: [HACKERS] Problem with the numbers I reported yesterday
Date
Msg-id 9802121822.AA27185@dolomite.paracel.com
Whole thread Raw
In response to Re: [HACKERS] Problem with the numbers I reported yesterday  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Problem with the numbers I reported yesterday  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [HACKERS] Problem with the numbers I reported yesterday  ("Kent S. Gordon" <kgor@inetspace.com>)
List pgsql-hackers
Bruce Momjian wrote:
>
> >
> > Hi,
> >
> > perhaps a stupid question:
> >
> > What will happen, if you start PostgreSQL with -F and write a script
> > which is a loop that fsyncs every 2 seconds? Does this lead to a
> > database which is "almost" correct? Does this seem like a good
> > compromise?
>
> Well, you really have to sync the data pages BEFORE sync'ing pg_log.

Why should this be necessary?  If the transaction is considered
committed once the log has be written, and the system crashes before
the data are written, then postgres can look at the data and logs when
it is next started up and apply all the transactions that were logged
but not committed to the data pages.

Am I missing something?  It seems to me if you sync the data pages
first, then what good is the log? (other than being able to retrace
your steps)

Ocie Mitchell

pgsql-hackers by date:

Previous
From: "Nguyen, Thuan"
Date:
Subject: ...
Next
From: Tom I Helbekkmo
Date:
Subject: Shared memory corruption?