Re: PostgreSQL, NetBSD and NFS

From: "Greg A(dot) Woods" <woods(at)weird(dot)com>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: current-users(at)netbsd(dot)org, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL, NetBSD and NFS
Date: 2003-01-31 19:07:09
Message-ID: 20030131190709.1E93DA@proven.weird.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[ On Friday, January 31, 2003 at 11:54:27 (-0500), D'Arcy J.M. Cain wrote: ]
> Subject: Re: PostgreSQL, NetBSD and NFS
>
> On Thursday 30 January 2003 18:32, Simon J. Gerraty wrote:
> > Is postgreSQL trying to lock a file perhaps? Would seem a sensible thing
> > for it to be doing...
>
> Is that a problem? FWIW I am running statd and lockd on the NetBSD box.

NetBSD's NFS implementation only supports locking as a _server_, not a
client.

http://www.unixcircle.com/features/nfs.php

Optional for file locking (lockd+statd):

lockd:

Rpc.lockd is a daemon which provides file and record-locking services
in an NFS environment.

FreeBSD, NetBSD and OpenBSD file locking is only supported on server
side.

NFS server support for locking was introduced in NetBSD-1.5:

http://www.netbsd.org/Releases/formal-1.5/NetBSD-1.5.html

* Server part of NFS locking (implemented by rpc.lockd(8)) now works.

and as you can also see from rcp.lockd/lockd.c:

----------------------------
revision 1.5
date: 2000/06/07 14:34:40; author: bouyer; state: Exp; lines: +67 -25
Implement file locking in lockd. All the stuff is done in userland, using
fhopen() and flock(). This means that if you kill lockd, all locks will
be relased (but you're supposed to kill statd at the same time, so
remote hosts will know it and re-establish the lock).
Tested against solaris 2.7 and linux 2.2.14 clients.
Shared lock are not handled efficiently, they're serialised in lockd when they
could be granted.
----------------------------

Terry Lambert has some proposed fixes to add NFS client level locking to
the FreeBSD kernel:

http://www.freebsd.org/~terry/DIFF.LOCKS.txt
http://www.freebsd.org/~terry/DIFF.LOCKS.MAN
http://www.freebsd.org/~terry/DIFF.LOCKS

--
Greg A. Woods

+1 416 218-0098; <g(dot)a(dot)woods(at)ieee(dot)org>; <woods(at)robohack(dot)ca>
Planix, Inc. <woods(at)planix(dot)com>; VE3TCP; Secrets of the Weird <woods(at)weird(dot)com>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2003-01-31 19:08:04 Re: [mail] Re: Windows Build System
Previous Message Kurt Roeckx 2003-01-31 19:04:46 Re: Linux.conf.au 2003 Report