Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-21 Thread Florian Pflug
On May21, 2012, at 20:20 , Tom Lane wrote: > I wonder whether we should dedicate a buffer status bit to show that > the buffer has been zeroed by zero_damaged_pages and thus doesn't > reflect what's on disk. Then we could teach autovacuum to not overwrite > such pages. +1. The idea of us overwrit

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-21 Thread Tom Lane
Robert Haas writes: > On Mon, May 21, 2012 at 12:43 PM, Tom Lane wrote: >> 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 c

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-21 Thread Robert Haas
On Mon, May 21, 2012 at 12:43 PM, Tom Lane wrote: > Robert Haas writes: >> On Mon, May 21, 2012 at 12:23 PM, Tom Lane 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

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-21 Thread Tom Lane
Robert Haas writes: > On Mon, May 21, 2012 at 12:23 PM, Tom Lane 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 >

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-21 Thread Robert Haas
On Mon, May 21, 2012 at 12:23 PM, Tom Lane 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, zeroi

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-21 Thread Tom Lane
Robert Haas writes: > On Sun, May 20, 2012 at 2:12 PM, Alvaro Herrera > wrote: >>> Yeah, an enum would be nicer than an additional GUC. I kinda keep forgetting >>> that we have those. Though to bikeshed, the GUC should probably be just >>> called >>> 'zero_pages' and take the values 'never', 'mi

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-21 Thread Robert Haas
On Sun, May 20, 2012 at 2:12 PM, Alvaro Herrera wrote: >> Yeah, an enum would be nicer than an additional GUC. I kinda keep forgetting >> that we have those. Though to bikeshed, the GUC should probably be just >> called >> 'zero_pages' and take the values 'never', 'missing', 'unreadable' ;-) > >

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-20 Thread Alvaro Herrera
Excerpts from Florian Pflug's message of sáb may 19 03:48:51 -0400 2012: > > On May18, 2012, at 23:18 , Alvaro Herrera wrote: > > Excerpts from Florian Pflug's message of jue may 17 09:08:26 -0400 2012: > > Seems to me that we could make zero_damaged_pages an enum. The default > > value of "on"

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-19 Thread Florian Pflug
On May18, 2012, at 23:18 , Alvaro Herrera wrote: > Excerpts from Florian Pflug's message of jue may 17 09:08:26 -0400 2012: >> On May16, 2012, at 15:51 , Tom Lane wrote: > >>> It is by design, in that the only contemplated case was truncated-away >>> pages. I'm pretty hesitant to consider allowin

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-18 Thread Alvaro Herrera
Excerpts from Florian Pflug's message of jue may 17 09:08:26 -0400 2012: > On May16, 2012, at 15:51 , Tom Lane wrote: > > 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 … >

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-17 Thread Florian Pflug
On May16, 2012, at 15:51 , Tom Lane wrote: > Alvaro Herrera 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,

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-16 Thread Alvaro Herrera
Excerpts from Tom Lane's message of mié may 16 09:51:26 -0400 2012: > Alvaro Herrera 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_dum

Re: [HACKERS] read() returns ERANGE in Mac OS X

2012-05-16 Thread Tom Lane
Alvaro Herrera 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 gla

[HACKERS] read() returns ERANGE in Mac OS X

2012-05-16 Thread Alvaro Herrera
Hi, 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