Re: Patch to improve reliability of postgresql on linux nfs

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: George Barnett <gbarnett(at)atlassian(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to improve reliability of postgresql on linux nfs
Date: 2011-09-09 17:44:05
Message-ID: 20110909174405.GC25219@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 09, 2011 at 10:27:22AM -0400, Tom Lane wrote:
> George Barnett <gbarnett(at)atlassian(dot)com> writes:
> > [ patch to retry writes on NFS ]
>
> I'm having a hard time getting excited about this idea, because IMO
> NFS is insufficiently reliable to run a database on, and no patch like
> this can fix that. However, some concrete points:
>
> 1. If writes need to be retried, why not reads? (No, that's not an
> invitation to expand the scope of the patch; it's a question about NFS
> implementation.)

To support all POSIX:2008-conforming read() implementations, we must indeed
retry reads. I suppose the OP never encountered this in practice, though.

> 2. What is the rationale for supposing that a retry a nanosecond later
> will help? If it will help, why didn't the kernel just do that?

POSIX:2008 unconditionally permits[1] partial writes of requests exceeding 512
bytes (_POSIX_PIPE_BUF). We shouldn't complain when a kernel provides a
conforming write(), even if it appears that the kernel achieved little by
using some freedom afforded it.

> 3. What about EINTR? If you believe that this is necessary, then the
> kernel logically has to return EINTR when it would like you to retry but
> it hasn't been able to write any bytes yet. If you get a zero return
> you have to assume that means out-of-disk-space.

Assuming conforming SA_RESTART for write()/read(), this will not happen. The
call will restart and resume blocking until it writes something.

nm

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nulik Nol 2011-09-09 18:15:40 fsyncing data to disk
Previous Message Josh Berkus 2011-09-09 17:40:49 Re: unite recovery.conf and postgresql.conf