Re: [HACKERS] Problem with the numbers I reported yesterday

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: ocie(at)paracel(dot)com
Cc: boersenspiel(at)vocalweb(dot)de, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Problem with the numbers I reported yesterday
Date: 1998-02-12 19:16:29
Message-ID: 199802121917.OAA29497@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

No, on restart, you can't identify the old/new data. Remember, pg_log
is just the transaction id and a flag. The superceeded/new rows are
mixed on the data pages, with transaction id's as markers.

>
> 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)

Again, the log is just a list of transaction ids, and their statuses.

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-02-12 19:39:26 Re: [HACKERS] Shared memory corruption?
Previous Message Tom I Helbekkmo 1998-02-12 18:27:53 Shared memory corruption?