Re: read() returns ERANGE in Mac OS X

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Florian Pflug <fgp(at)phlo(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: read() returns ERANGE in Mac OS X
Date: 2012-05-21 17:59:02
Message-ID: CA+TgmoaS31wHFKitYkk9dYpP2pqFxwZzXLeQAxgNgNGQ0Mg25w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 21, 2012 at 12:43 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Mon, May 21, 2012 at 12:23 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> If we were sure that the kernel error was permanent, then this argument
>>> would be moot: the data is gone already.  The scary thought here is that
>>> it might be a transient error, such as a not-always-repeatable kernel
>>> bug.  In that case, zeroing the page would indeed lose data that had
>>> been recoverable before.
>
>> Yeah, and in fact I think that's probably not a terribly remote
>> scenario.   Also, if you're running on dying hardware, you really do
>> NOT want to force the kernel to write a whole bunch of pages back to
>> the dying disk in the midst of trying to pg_dump it before it falls
>> over.  You just want to read what you can of what's there now.
>
> Hm?  zero_damaged_pages doesn't cause the buffer to be marked dirty,
> so I dunno where these alleged writes are coming from.

I'm not sure either, but I'm pretty sure I've seen at least one case
where turning it on caused a whole lotta data to disappear.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2012-05-21 18:10:09 Re: Draft release notes complete
Previous Message Robert Haas 2012-05-21 17:56:52 heap metapages