Re: What is the relationship between checkpoint and wal

From: Florian Weimer <fweimer(at)redhat(dot)com>
To: Luca Ferrari <fluca1978(at)infinito(dot)it>
Cc: 高健 <luckyjackgao(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: What is the relationship between checkpoint and wal
Date: 2013-08-26 10:54:09
Message-ID: 521B33D1.1070506@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/26/2013 11:37 AM, Luca Ferrari wrote:
> On Mon, Aug 26, 2013 at 4:57 AM, 高健 <luckyjackgao(at)gmail(dot)com> wrote:
>> But why "writes the entire content of each disk page to WAL "?
>>
>
> The documentation states that: "The row-level change data normally
> stored in WAL will not be enough to completely restore such a page
> during post-crash recovery.". I guess that a mixed page (i.e., a page
> that contains old and new data) cannot be safely recovered with
> deltas, so you need to have a "clean" page image to which start
> recovery.

Correct, the full-page image is needed for restoring the known state of
a page.

It also speeds up recovery because you can just fire off writes to the
pages under recovery, followed by incremental updates to the cached
copy. Without full page writes, you'd have to read the current version
of the page from the disk first, often resulting in somewhat random read
activity during recovery.

--
Florian Weimer / Red Hat Product Security Team

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mistina Michal 2013-08-26 12:53:23 Re: postmaster.pid still exists after pacemaker stopped postgresql - how to remove
Previous Message Luca Ferrari 2013-08-26 09:37:11 Re: What is the relationship between checkpoint and wal