Subject: [nfsv4] How should a server use NFSERR_EXPIRED

From: [email-masked]
Date: Fri, 4 Jul 2003 14:17:35 -0400 (EDT)

Hi,

Hope you don't mind another clarification question. I've read Section 8.6.3
(the first two paragraphs) and it still isn't clear to me exactly what a
server should do when:
- client A get a lock on file X
- client A becomes network partitioned from server
- client B asks for lock on X after client A's lease has expired
- server revokes client A's lock on file X so client B can have lock
  (and writes record in stable storage denoting client A state revoked)
- network partition between server and client A heals

Now, client A sends a request with a stateid issued before the network
partition. So, what is the server required to do?

1) - return NFSERR_EXPIRED for all requests using any stateid issued to
    client A before the state was revoked (and what about Renew and
    Release_lock_owner, that only have a clientid in their arguments)
OR
2) - return NFSERR_EXPIRED for the stateid(s) referring to the lock(s)
    that were revoked while allowing other stateid(s) issued before the
    network partition to work

And then, how does client A renew the lease? Since NFSERR_EXPIRED is
listed as an error return for Renew, does the server return NFSERR_EXPIRED
but still renew the client's lease at that point? If 1) above is the
correct response and returning NFSERR_EXPIRED doesn't renew a lease
as a side effect (the RFC notes that leases are renewed when a "valid
stateid" is used by an op. Are stateids issued before the network
partition considered valid even if the state was revoked?), then...

How does a client renew the lease after a network partition has resulted
in a loss of the lease and a revocation of state at the server?

A quirky side effect of 2) is that, if the server crashes after the
partition heals but before any stateid for revoked state is used, the
client wouldn't see an error until it tries to Reclaim the revoked lock
and then it would get NFSERR_NOGRACE, I think?

Any help with this would be appreciated, rick

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/nfsv4

---

From: "Noveck, Dave" <[email-masked]>
Date: Sat, 5 Jul 2003 07:38:28 -0700

Rick wrote: 
> Hope you don't mind another clarification question. 

Well if we did, it would behoove us to write something a whole
lot clearer.

> I've read Section 8.6.3

Note that in the first two paragraphs of section 8.6.3, it discusses 
two different approaches to handling locks when expiration occurs.  In 
the first all of the locks simply go immediately upon expiration 
while in the second you avoid losing a lock for as long as you can, 
only giving up a log when there is a conflict.  I'll refer these below 
as "standard" and "premium".

So I'm assuming from your question that your server implements the 
premium handling.

>     network partition to work

My interpretation of this is that case 1, including that for operations
within a clientid, is intended for standard handling of this situation and
does not apply to your server.  I think you would follow case 2.

> in a loss of the lease and a revocation of state at the server?

In the case in which the server has adopted standard handling, there is
no lease to renew and you are going to get an EXPIRED error forever.  In
that case, I would say the client should do a new setclient-id and use
that new clientid for future communication with the server.

If the server has adopted premium handling of this situation then I would
say that EXPIRED only applies to any locks actually lost.  Using a stateid
not associated with a lost lock, or doing a renew, causes the lease to
be renewed, with no error indication.  Even though the lease has been
renewed, if the stateid's for the revoked lock are used, an EXPIRED error
will result.  

>From the viewpoint of the client, he can't know which handling the server
has adopted, so I would say that if he gets EXPIRED using some stateid,
he should do a RENEW and then conclude that he has had one or more locks
revoked if he gets no error on the RENEW or else that he has lost all
locks if he gets an EXPIRED error on the RENEW, and thus needs to re-establish
his connection with the server by getting a new clientid.

> and then it would get NFSERR_NOGRACE, I think?

Yes.