Re: zero_damaged_pages doesn't work

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: David Boreham <david_list(at)boreham(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: zero_damaged_pages doesn't work
Date: 2010-09-27 22:40:28
Message-ID: 1285627228.32386.5.camel@jdavis-ux.asterdata.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2010-09-27 at 15:07 -0600, David Boreham wrote:
> Is the zero_damaged_pages feature expected to work in 8.3.11 ?
>
> I have a fair bit of evidence that it doesn't (you get nice messages
> in saying that the page is being zeroed, but the on-disk data does not
> change).
> I also see quite a few folk reporting similar findings in various form
> and mailing list posts over the past few years.
>
> I can use dd to zero the on-disk data, but it'd be nice to know
> definitively if this feature is expected to work, and if so under
> what conditions it might not.

It does zero the page in the buffer, but I don't think it marks it as
dirty. So, it never really makes it to disk as all-zeros.

> fwiw I am enabling zero_damaged_pages using a set command
> in a client session, not in the server's config file. The symptoms
> I observe are that a query that previously errored out due to
> a bad page header error will succeed when zero_damaged_pages
> is enabled, the log says that the page is being zeroed.
> However the same query run subsequently without zero_damaged_pages
> will again fail, and pg_filedump shows that the on-disk data
> hasn't changed.

The subsequent queries may succeed if the page is still in the buffer
cache.

zero_damaged_pages is not meant as a recovery tool. It's meant to allow
you to pg_dump whatever data is not damaged, so that you can restore
into a fresh location.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Boreham 2010-09-27 22:45:32 Re: zero_damaged_pages doesn't work
Previous Message Larry Leszczynski 2010-09-27 22:35:58 PostgreSQL 9 Mac OS X one-click install - PL/perl broken