Re: PostgreSQL over NFS? - Mailing list pgsql-general

From Alfred Perlstein
Subject Re: PostgreSQL over NFS?
Date
Msg-id 20010209162310.Y26076@fw.wintelcom.net
Whole thread Raw
In response to Re: PostgreSQL over NFS?  (Shaw Terwilliger <sterwill@sourcegear.com>)
Responses Re: PostgreSQL over NFS?
Re: PostgreSQL over NFS?
List pgsql-general
* Shaw Terwilliger <sterwill@sourcegear.com> [010209 16:18] wrote:
> Alfred Perlstein wrote:
> > Actually NFS has very strong write ordering semantics, it just has
> > terrible cache coherency.  Meaning two machines accessing the same
> > file will most likely see different things if the file is updated
> > moderately.
>
> I'm not an NFS guru by any means, but I've noticed episodes of cache
> incoherency from NFS-mounted home directories on two workstations.
> Running two postgresql database servers on two hosts accessing the
> same data space through NFS sounds like asking for corruption, and
> was, luckily, never suggested.

My statement is also incorrect, NFS has loose write ordering
semantics, but it does have strong reliability, meaning that
fsync(2)/close(2) must sync all data to backing NFS server or return
an error.

The part about cache incoherency is very true, the _only_ cache coherency
NFS offers is _only_ in the v3 spec, and is specifically called 'wcc'
'weak cache coherency' (afaik).  So yes, you can expect differnent
NFS clients to get different inconsistant views on heavily modified
files unless they use advisory locking (which should fsync out locked
ranges before release).

Anyhow, if the idea is just to get a nice backup system, you could
do a pg_dump and write the output to a NFS mounted FS, there's probably
less that can go wrong with a large sequencial write than heavy shared
read/write/seek.

--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

pgsql-general by date:

Previous
From: Shaw Terwilliger
Date:
Subject: Failover (was Re: PostgreSQL over NFS?)
Next
From: Alfonso Peniche
Date:
Subject: bug with distinct?