Subject: [nfsv4] CLAIM_DELEGATE_CUR opens and the grace period

From: "Noveck, Dave" <[email-masked]>
Date: Fri, 29 Feb 2008 16:24:46 -0500

Someone implementing v4.0 raised the issue of reclaiming
CLAIM_DELEGATE_CUR opens.  It sems that this type of open (and
CLAIM_DELEG_CUR_FH) should not have to wait for the grace period to be
over, since the granting/reclaiming of the delegation done previously
assures that there can be no conflict with locks reclaimed by other
clients.

So I propose changing:

   For OPEN requests whose claim type is other than CLAIM_PREVIOUS (i.e.
   requests other than those devoted to reclaiming opens after a server
   reboot) that reach the server during its grace or lease expiration
   period, the server returns an error of NFS4ERR_GRACE.

to:

   For OPEN requests that reach the server during the grace period, the
   server returns an error or NFS4ERR_GRACE.  The following claim types
   are exceptions:

   o  Opens specifying the claim type CLAIM_PREVIOUS are devoted to 
      reclaiming opens after a server reboot and are typically only  
      valid during the grace period.

   o  Opens specifying the claim types CLAIM_DELEGATE_CUR and 
      CLAIM_DELEG_CUR_FH are both during and after the grace period.
      Since the granting of the delegation that they are subordinate
      to assures that there is no conflict with locks to be reclaimed
      by other clients, the server need not return NFS4ERR_GRACE when
      these are received during the grace period.
_______________________________________________
nfsv4 mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/nfsv4

---

From: "J. Bruce Fields" <[email-masked]>
Date: Fri, 29 Feb 2008 16:59:38 -0500

>       CLAIM_DELEG_CUR_FH are both during and after the grace period.

s/are both/are valid both/ ??

--b.

---

From: "Noveck, Dave" <[email-masked]>
Date: Fri, 29 Feb 2008 17:05:11 -0500

> s/are both/are valid both/ ??

Yes.

-----Original Message-----
From: J. Bruce Fields [mailto:[email-masked]] 
Sent: Friday, February 29, 2008 5:00 PM
To: Noveck, Dave
Cc: [email-masked]
Subject: Re: [nfsv4] CLAIM_DELEGATE_CUR opens and the grace period

--b.

---

From: Rick Macklem <[email-masked]>
Date: Fri, 29 Feb 2008 17:26:26 -0500 (EST)

>      these are received during the grace period.

I admit I don't really see any benefit to allowing this. During grace, the 
client will have to recover the delegation via Open/CLAIM_PREVIOUS and it 
will get an Open along with the delegation at that point. I also can't
think of why a server would do a DelegRecall during grace, which is
normally why a client does an Open/CLAIM_DELEGATE_CUR.

What the change might do is make v4.0 clients think that grace is over
prematurely and then "be surprised" by NFS4ERR_GRACE on a subsequent
operation, such as Open/CLAIM_NULL. (As such, I don't think the change
should be applied to v4.0.)

On a slight tangent... I am now gaining some operational experience with
v4.0 here and, sofar, recovery from NFS4ERR_EXPIRED is much more
important than recovery from NFS4ERR_STALECLIENTID/NFS4ERR_STALESTATEID.
Why? Well, my production servers haven't crashed in at least a year, so
the latter just isn't happening. However, NFS4ERR_EXPIRED is fairly
common, since TGTs/credential handles become stale overnight and Renews
fail. (This normally corresponds to an inactive client, so there isn't
usually much to recover. Often no current Opens, so the client just
loses any delegations it had and goes on.) My operational clients are
Macs which do not use keytab entries for any client side "host based
credential" that can be used for Renew, etc.

I just thought I'd mention this, since I don't see a need to "optimize"
recovery from server reboots, just correctness.

Have a good weekend, rick

---

From: "Noveck, Dave" <[email-masked]>
Date: Fri, 29 Feb 2008 18:02:25 -0500

> I admit I don't really see any benefit to allowing 
> this. During grace, the client will have to recover 
> the delegation via Open/CLAIM_PREVIOUS and it will 
> get an Open along with the delegation at that point. 
> I also can't think of why a server would do a 
> DelegRecall during grace, which is normally why a 
> client does an Open/CLAIM_DELEGATE_CUR.

You're right it is normally why a client does that but the spec allows
it whenever you have a delegation.  Given that it is a valid state of
affairs to have such an open, I think it is better to allow the client
to simply recover that valid state of affairs as simply as possible.

> What the change might do is make v4.0 clients think 
> that grace is over prematurely and then "be surprised" 
> by NFS4ERR_GRACE on a subsequent operation, such as 
> Open/CLAIM_NULL. (As such, I don't think the change 

Although the context was that someone implementing v4.0 asked me about
this, the proposed change is for v4.1.  There is no proposal to change
v4.0 and RFC3530 remains the definition of v4.0.

> Well, my production servers haven't crashed in at 
> least a year, so the latter just isn't happening.

That's great but I'm superstitious about making such statements.  After
I do, A/C or power supply problems start making me wish I hadn't.  Some
client applications have availability requirements that make quick lock
reclaim quite important, even when the server failure occurs only once a
year.  So I'm glad that v4.1 has improved both server restart recovery
and recovery from expired locks, relative to v4.0.

The big improvement for restart recovery is RECLAIM_COMPLETE.  The other
improvement for server restart is persistent sessions to foreclose the
possibility that retransmitted request will incorrectly fail because of
retransmitted request and a reply cache lost during restart.  There
needs to be a lot of server implementation work to support that, but at
least we have protocol support for exactly-once semantics in that case.

V4.1 did a lot of work in cleaning up recovery from expired locks.
There is a lot more clarity about dealing with these situations.
SEQUENCE status bits alert you to the existence of the situation, you
have a clean way of finding expired stateids and a way to let the server
know you have seen them and he can drop the information cleanly.  

-----Original Message-----
From: Rick Macklem [mailto:[email-masked]] 
Sent: Friday, February 29, 2008 5:26 PM
To: Noveck, Dave
Cc: [email-masked]
Subject: Re: [nfsv4] CLAIM_DELEGATE_CUR opens and the grace period

>      these are received during the grace period.

I admit I don't really see any benefit to allowing this. During grace,
the client will have to recover the delegation via Open/CLAIM_PREVIOUS
and it will get an Open along with the delegation at that point. I also
can't think of why a server would do a DelegRecall during grace, which
is normally why a client does an Open/CLAIM_DELEGATE_CUR.