Skip site navigation (1) Skip section navigation (2)

Re: read() returns ERANGE in Mac OS X

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: read() returns ERANGE in Mac OS X
Date: 2012-05-16 13:51:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to


pgsql-hackers by date

Next:From: Andrew DunstanDate: 2012-05-16 14:23:07
Subject: Re: 9.2beta1 regression: pg_restore --data-only does not set sequence values any more
Previous:From: Alvaro HerreraDate: 2012-05-16 13:39:13
Subject: read() returns ERANGE in Mac OS X

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group