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

RE: WAL documentation

From: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
To: "'Barry Lind'" <barry(at)xythos(dot)com>, pgsql-hackers(at)postgresql(dot)org
Cc: postgresql-docs(at)postgresql(dot)org
Subject: RE: WAL documentation
Date: 2001-01-24 21:25:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> 1) In the 'WAL Parameters' section, paragraph 3 there is the following
> sentence: "After a checkpoint has been made, any log segments written
> before the redo record may be removed/archived..."  What does the 'may'
> refer mean? Does the database administrator need to go into the 
> directory and remove the no longer necessary log files?  What does
> archiving have to do with this? If I archived all log files, could
> I roll forward a backup made previously? That is the only reason I can
> think of that you would archive log files (at least that is why you
> archive log files in Oracle).

Offline log segments are removed automatically at checkpoint time.
WAL based BAR is not implemented yet, so no archiving is made

> 2) The doc doesn't seem to explain how on database recovery 
> the database knows which log file to start with. I think walking
> through an example of how after a database crash, the log file is
> used for recovery, would be useful. At least it would make me as
> a user of postgres feel better if I understood how crashes are
> recovered from.

After checkpoint is made (log flushed) its position is saved in
pg_control file. So, on recovery backend first read pg_control,
than checkpoint record, than redo record (its position is saved
in checkpoint) and begins REDO op. Because of entire content of
pages is saved in log on first-after-checkpoint page modification
pages will be first restored to consistent stage.

Using pg_control to get checkpoint position speed up things but
to handle possible pg_control corruption we obviously should
implement reading existent log segments (from the last one -
newest - to oldest) to get last checkpoint.


pgsql-hackers by date

Next:From: Peter EisentrautDate: 2001-01-24 21:36:37
Subject: Re: LEFT JOIN in pg_dumpall is a bug
Previous:From: Hannu KrosingDate: 2001-01-24 21:07:59
Subject: Re: Open 7.1 items

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