Re: Patch to improve reliability of postgresql on linux nfs

Florian G. Pflug <fgp@phlo.org>

From: Florian Pflug <fgp@phlo.org>
To: George Barnett <gbarnett@atlassian.com>
Cc: Bernd Helmle <mailings@oopsware.de>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-09-12T05:59:32Z
Lists: pgsql-hackers
On Sep12, 2011, at 06:30 , George Barnett wrote:
> On 10/09/2011, at 1:30 AM, Bernd Helmle wrote:
> 
>> --On 9. September 2011 10:27:22 -0400 Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 
>>> On the whole I think you'd be better off lobbying your NFS implementors
>>> to provide something closer to the behavior of every other filesystem on
>>> the planet.  Or checking to see if you need to adjust your NFS
>>> configuration, as the other responders mentioned.
>> 
>> You really need at least mount options 'hard' _and_ 'nointr' on NFS mounts, otherwise you are out of luck. Oracle and DB2 guys recommend those settings and without them any millisecond of network glitch could disturb things unreasonably.
> 
> My mount options include hard and intr.

If you really meant to say "intr" there (and not "nointr") then that probably explains the partial writes.

Still, I agree with Noah and Kevin that we ought to deal more gracefully with this, i.e. resubmit after a partial read() or write(). AFAICS there's nothing to be gained by not doing that, and the increase in code complexity should be negligible. If we do that, however, I believe we might as well handle EINTR correctly, even if SA_RESTART should prevent us from ever seeing that.

best regards,
Florian Pflug