Byte Range File Locking with NFSv3
In order to help NFSv3 clients protect NFS files from data consistency conflicts, VAST Cluster supports NLMv4 locks. NFS client applications can acquire read or write NLM locks on byte ranges or on whole files.
VAST Cluster leverages StorageClassMemory to persist lock information directly within the file system metadata tree. This reduces lock latency and ensures that all nodes have instant access to the current lock state of any file. There is no limit to the number of files that can have locks within the file system. However, because locks occupy a portion of a file's metadata structure, there is a limit on the number of locks that can simultaneously be held on a given file. This limit varies based on the length of the host names holding a lock.
As a rough guideline, up to 100,000 locks can be held per file when the host name is 40 characters in length.
VAST Cluster enables you to remove NLM locks from the VAST Cluster NFS server. This feature is designed to help you in the event that a client OS crashes and leaves behind locks. It releases the locks from the file and enables another client to lock the file.
Locks are otherwise removed automatically by NSM.
Caution
Do not remove locks from the server when the client application that locked the files is still active. Once the lock is removed from VAST Cluster's NFS server, another client application will be able to acquire another lock on the same byte range.
Note
NLM locking is advisory. Advisory locking keeps track of which files and byte ranges have been locked by which process, but does not prevent a process from writing to a file that is locked by another process. A process can ignore an advisory lock if the process has adequate permission.
Byte Range File Locking with NFSv4.1
Byte range file locking is supported as part of the NFSv4.1 protocol. The file locking support is structured so that an RPC callback mechanism is not required. This is a departure from the NFSv3 version of the NFS file locking protocol, Network Lock Manager (NLM).
You can list byte range locks on any given file path and release them.