Re: does database shut down cleanly when WAL device fails?

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: Brandon Craig Rhodes <brandon(at)rhodesmill(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: does database shut down cleanly when WAL device fails?
Date: 2005-05-05 02:41:34
Message-ID: 200505050241.j452fYu05872@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Brandon Craig Rhodes <brandon(at)rhodesmill(dot)org> writes:
> > And the disputed point:
>
> > - If the drive holding the WAL fails, then the database engine
> > will shut down cleanly by writing everything in RAM out to
> > the real database tables, and no data will be lost.
>
> Whoever claimed that has no familiarity with the code at all, and no
> understanding of the basic WAL rule: write to the log BEFORE you write
> data.
>
> In point of fact, loss of the WAL drive will mean a database PANIC stop
> and probably a corrupt data area afterwards, since there'd be no
> guarantee that related page updates had all made it to disk.

Also the WAL files might be recyled at each checkpoint, which is at
least every five minutes, so pg_xlog will not contain all the WAL files
from the backup, unless you are using point-in-time recovery --- this
might be where you got confused.

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

Browse pgsql-general by date

  From Date Subject
Next Message Karl O. Pinc 2005-05-05 05:05:33 Rpm packaging of 8.0.2 libraries
Previous Message Vlad 2005-05-05 02:06:03 Re: postgresql replication