Re: read() returns ERANGE in Mac OS X - Mailing list pgsql-hackers

From Tom Lane
Subject Re: read() returns ERANGE in Mac OS X
Date
Msg-id 24254.1337176286@sss.pgh.pa.us
Whole thread Raw
In response to read() returns ERANGE in Mac OS X  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: read() returns ERANGE in Mac OS X
Re: read() returns ERANGE in Mac OS X
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> We just came across a situation where a corrupted HFS+ filesystem
> appears to return ERANGE on a customer machine.  Our first reaction was
> to turn zero_damaged_pages on to allow taking a pg_dump backup of the
> database, but surprisingly this does not work.  A quick glance at the
> code shows the reason:
> ...
> Note that zero_damaged_pages only enters the picture if it's a short
> read, not if the read actually fails completely.

> Is this by design, or is this just an oversight?

It is by design, in that the only contemplated case was truncated-away
pages.  I'm pretty hesitant to consider allowing arbitrary kernel errors
to be ignored here ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: read() returns ERANGE in Mac OS X
Next
From: Hitoshi Harada
Date:
Subject: Re: Missing optimization when filters are applied after window functions