Re: Patch to improve reliability of postgresql on linux nfs - Mailing list pgsql-hackers

From Aidan Van Dyk
Subject Re: Patch to improve reliability of postgresql on linux nfs
Date
Msg-id CAC_2qU_6YGqskR3Qu4Mxj4MP-ecKM7ABJj-Svdk1Y+ZrW0Xuew@mail.gmail.com
Whole thread Raw
In response to Re: Patch to improve reliability of postgresql on linux nfs  (Florian Pflug <fgp@phlo.org>)
Responses Re: Patch to improve reliability of postgresql on linux nfs
List pgsql-hackers
On Tue, Sep 13, 2011 at 10:14 AM, Florian Pflug <fgp@phlo.org> wrote:

>> Personally, I'ld think that's ripe for bugs.   If the contract is that
>> ret != amount is the "error" case, then don't return -1 for an error
>> *sometimes*.
>
> Hm, but isn't that how write() works also? AFAIK (non-interruptible) write()
> will return the number of bytes written, which may be less than the requested
> number if there's not enough free space, or -1 in case of an error like
> an invalid fd being passed.

Looking through the code, it appears as if all the write calls I've
seen are checking ret != amount, so it's probably not as big a deal
for PG as I fear...

But the subtle change in semantics (from system write ret != amount
not necessarily a real error, hence no errno set) of pg_write ret !=
amount only happening after a "real error" (errno should be set) is
one that could yet lead to confusion.

a.


--
Aidan Van Dyk                                             Create like a god,
aidan@highrise.ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.


pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: SSL key with passphrase
Next
From: Tom Lane
Date:
Subject: Re: timezone GUC