[OpenAFS] behavior of whole-file locks when a client disappears?

Jeffrey Altman jaltman@secure-endpoints.com
Thu, 20 Jul 2006 22:18:35 -0400


This is a cryptographically signed message in MIME format.

--------------ms060608010604050603040103
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Adam Megacz wrote:
> If a client obtains a whole-file lock and then vanishes (is unplugged
> from the network with no warning), does that lock stay around forever,
> or does the server eventually release it after being unable to ping
> the client for a certain amount of time?
> 
>   - a

Locks in AFS are supposed to behave as follows:

(1) A lock (read or write) is issued for a period of five
    minutes.

(2) Clients are required to renew their locks prior to
    expiration.

(3) If a client fails to renew a lock for any reason
    the lock will be released by the server.

(4) If the client attempts to renew a lock that was released
    the client will be informed by an error.  The client should
    then respond to the error.

There are some quirky behaviors in the current implementations of
the clients and servers that will change in the future:

(a) The file server does not track which client a lock was
    issued to.  When a read lock is issued to more than one
    client, the lock count is incremented for each granted lock.
    All the lock counts are renewed whenever any of the clients
    renew their lock within five minutes.  If more than one client
    obtains requests a read lock on the same file, and one
    of the clients disappears for a while and then returns
    the lock will still be there as long as any other client
    renewed its instance of the lock.

    In the future, the file server will track locks by client.

(b) If a lock is dropped by the file server, the client will
    receive an error in response to the next renewal request.
    The existing Unix clients ignore the error and proceed
    as if the lock was still valid.  This can lead to consistency
    issues.

    I don't know how this will be altered on Unix.  The Windows
    AFS CIFS server implements the CIFS behavior in which a lost
    lock results in the file handle being invalidated.

Jeffrey Altman

--------------ms060608010604050603040103
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJeTCC
AxcwggKAoAMCAQICEBW00lKwoWJXt8wbmTl1M0kwDQYJKoZIhvcNAQEEBQAwYjELMAkGA1UE
BhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25z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