Re: Patch to improve reliability of postgresql on linux nfs

From: Aidan Van Dyk <aidan(at)highrise(dot)ca>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: George Barnett <gbarnett(at)atlassian(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to improve reliability of postgresql on linux nfs
Date: 2011-09-13 14:32:01
Message-ID: CAC_2qU_6YGqskR3Qu4Mxj4MP-ecKM7ABJj-Svdk1Y+ZrW0Xuew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 13, 2011 at 10:14 AM, Florian Pflug <fgp(at)phlo(dot)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(at)highrise(dot)ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-09-13 14:34:24 Re: timezone GUC
Previous Message Thom Brown 2011-09-13 14:28:25 Re: SSL key with passphrase