Re: [PATCHES] Infrastructure changes for recovery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: List pgsql-patches <pgsql-patches(at)postgresql(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Infrastructure changes for recovery
Date: 2008-09-29 14:13:59
Message-ID: 11540.1222697639@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> I think we can get away with writing the LSN value to disk, as you
> suggested, but only every so often. No need to do it after every WAL
> record, just consistently every so often, so it gives us a point at
> which we know we are safe.

Huh? How does that make you safe? What you need to know is the max
LSN that could possibly be on disk.

Hmm, actually we could get away with tying this to fetching WAL files
from the archive. When switching to a new WAL file, write out the
*ending* WAL address of that file to pg_control. Then process the WAL
records in it. Whether or not any of the affected pages get to disk,
we know that there is no LSN on disk exceeding what we already put in
pg_control. If we crash and restart, we'll have to get to the end
of this file before we start letting backends in; which might be further
than we actually got before the crash, but not too much further because
we already know the whole WAL file is available.

Or is that the same thing you were saying? The detail about using
the end address seems fairly critical, and you didn't mention it...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-09-29 14:22:23 Fatal Errors
Previous Message Simon Riggs 2008-09-29 13:53:28 Re: [PATCHES] Infrastructure changes for recovery

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2008-09-29 15:06:44 Re: [PATCHES] Infrastructure changes for recovery
Previous Message Simon Riggs 2008-09-29 13:53:28 Re: [PATCHES] Infrastructure changes for recovery