> The more I think about this, the more disturbed I get.  It seems clear
> that this sequence is capable of writing out the checkpoint record
> before all dirty data pages have reached disk.  If we suffer a crash
> before the data pages do reach disk, then on restart we will 
> not realize we need to redo the changes to those pages.
> This seems an awfully large hole for what is claimed to be
> a bulletproof xlog technology.
> 
> I feel that checkpoint should not use sync(2) at all, but 
> should instead depend on fsync'ing the data files --- since
> fsync doesn't return until the write is done, this is considerably
> more secure.

I never was happy about sync() of course. This is just another reason
to re-write smgr. I don't know how useful is second sync() call, but
on Solaris (and I believe on many other *NIXes) rc0 calls it
three times, -:) Why?
Maybe now, with two checkpoints in log, we should start redo from
oldest one? This will increase recovery time of course -:(

Vadim

Mon, 12 Mar 2001 20:45:27 -0800
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
RE: xlog checkpoint depends on sync() ... seems unsafe
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
> Maybe now, with two checkpoints in log, we should start redo from
> oldest one? This will increase recovery time of course -:(

Yeah, and it doesn't even solve the problem: consider a crash just
after we've written a shutdown checkpoint record.  On restart,
we won't think we need to redo anything at all.

			regards, tom lane

Mon, 12 Mar 2001 23:48:53 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: xlog checkpoint depends on sync() ... seems unsafe 
On Mon, 12 Mar 2001, Mikheev, Vadim wrote:

> to re-write smgr. I don't know how useful is second sync() call, but
> on Solaris (and I believe on many other *NIXes) rc0 calls it
> three times, -:) Why?

The idea is, that by the time the last sync has run, the first sync will
be done flushing the buffers to disk. - this is what we were told by the
IBM engineers when I worked tier-2/3 AIX support at IBM.


-- 
Dominic J. Eidson
                                        "Baruk Khazad! Khazad ai-menu!" - Gimli
-------------------------------------------------------------------------------
http://www.the-infinite.org/              http://www.the-infinite.org/~dominic/


Mon, 12 Mar 2001 22:57:21 -0600 (CST)
"Dominic J. Eidson" <sauron@the-infinite.org>
Re: RE: xlog checkpoint depends on sync() ... seems unsafe