Re: WAL write of full pages

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WAL write of full pages
Date: 2004-03-16 15:55:27
Message-ID: 200403161555.i2GFtRF21666@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shridhar Daithankar wrote:
> Bruce Momjian wrote:
>
> > Shridhar Daithankar wrote:
> >>I can not see why writing an 8K block is any more safe than writing just the
> >>changes.
> >>
> >>I may be dead wrong but just putting my thoughts together..
> > The problem is that we need to record what was on the page before we
> > made the modification because there is no way to know that a write
> > hasn't corrupted some part of the page.
>
> OK... I think there is hardly any way around the fact that we need to flush a
> page the way we do it now. But that is slow. So what do we do.
>
> How feasible it would be to push fsyncing those pages/files to background writer
> and have it done on priority? That way the disk IO wait could get out of
> critical execution path. May be that could yield the performance benefit we are
> looking for.

We already allow committing transactions to flush WAL. We don't do the
flush when we write the page image to WAL, unless we can't get any other
buffer and have to write it ourselves and it hasn't already been
fsync'ed by another transaction. This is where the current LSN come in ---
it tells us how far fsync has gone, and each page has an LSN that tells
us when it was written to WAL.

--
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-hackers by date

  From Date Subject
Next Message Marty Scholes 2004-03-16 16:01:39 Re: WAL write of full pages
Previous Message Matthew T. O'Connor 2004-03-16 15:50:06 Re: [PERFORM] rapid degradation after postmaster restart