From owner-freebsd-arch@FreeBSD.ORG Sun Apr 12 19:44:34 2009 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8BCC106566B; Sun, 12 Apr 2009 19:44:34 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from mailhub.cs.uoguelph.ca (mailhub.cs.uoguelph.ca [131.104.94.205]) by mx1.freebsd.org (Postfix) with ESMTP id 9EB578FC13; Sun, 12 Apr 2009 19:44:34 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by mailhub.cs.uoguelph.ca (8.13.1/8.13.1) with ESMTP id n3CJiQpQ013604; Sun, 12 Apr 2009 15:44:26 -0400 Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n3CJoo503175; Sun, 12 Apr 2009 15:50:50 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Sun, 12 Apr 2009 15:50:50 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: Robert Watson In-Reply-To: Message-ID: References: <49D98461.4000002@elischer.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Scanned-By: MIMEDefang 2.63 on 131.104.94.205 Cc: Julian Elischer , freebsd-arch@FreeBSD.org Subject: Re: getting a callback ip address for nfsv4 client X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 19:44:35 -0000 On Sun, 12 Apr 2009, Robert Watson wrote: > > If we want to consider doing client-side disk caching, such as paging out NFS > buffer cache to local swap, having delegations so we can invalidate the cache > is fairly important. It becomes even more important if we want to do > persistent client-side disk caching across reboots, as found in systems like > AFS (does the NFSv4 design allow for this, or are client reboots still > necessarily considered terminal for all caching?) > Yes, what I am thinking of (I've coded parts of it, but always get distracted before I get it working:-) is whole file caching on local disk for delegated files, up to a certain size. And yes, if the delegation info is stored on stable storage, such as local disk, a client can recover it after a reboot. (Since no client currently does this, that part of current servers isn't heavily tested, so doing so could get "interesting":-) So, yes, I'd like to see delegations working, too. > The kind of scenario I have in mind isn't my IP address changing every 30 > seconds, in which case NFS will be fairly useless anyway. It's more the "My > IP changes twice a day when I suspend my notebook and commute to or from my > office", or alternatively "My desktop is behind a NAT at home, and the ISP > reboots my DSL modem once a month, which changes my ISP". In both of those > scenarios, quickly noticing and re-establishing the callback path so that > more effective caching can be used might make a significant difference. > The first scenario is problematic for nfsv4. If a client doesn't do a lease renewal within the server's chosen lease duration, the server has the right to throw away state, including locks and delegations. Most servers choose a lease duration of 1-2 minutes these days, so it needs to be "fast commute":-) Actually, my server chooses to be lenient and only expires state when it has to, due to a conflicting request or resource exhaustion and not just upon lease expiration, so you might be ok with a FreeBSD server, but not a Linux one (oh wait, you folks might actually consider that a feature:-). The second brings up the question of NAT, which I know diddly about. (I vaguely thought that neither rtalloc() nor getsockaddr() would work, since they would return 192.168.x.x and you really need the address assigned by the isp?) Can someone help w.r.t. what address to use when behind a NAT? Doug, maybe a client could optionally set an "upcall function" that would be called with the local ip address upon each reconnect to a server? (Then the nfsv4 client could check to see if the address had changed and do a fresh SetClientID/SetClientIDConfirm to change it, if it has?) > (Obviously, none of this really matters until delegations work...) Well, depends upon your definition of "work". At this point, they seem to function fine so long as the callback path is working and my client does do local opens and locking when it has a delegation. It doesn't yet do any clever caching and the FreeBSD kernel needs something (I am planning on posting a first stab at this in a few days) done before local VOP_RENAME() and VOP_ADVLOCK() calls to ensure consistency with locallly done ops. be added for correctness. rick