In a distributed or shared storage system (e.g., a network-attached storage (NAS) system or cluster), the potential for an error occurs when two or more clients or nodes are accessing the same resource (e.g., a file or piece of data). For example, an error could occur if two clients are permitted to read the same piece of data from a file, the first client updates the data and writes the new values back to the file, and the second client does not change the data but writes the old values back to the file, overwriting the updated values from the first client. To prevent this from occurring, a lock for the file is granted to the first client to access the file. Different types of locks (e.g., exclusive, shared, read-only, etc.) can be put in place depending on the type of access.
A software component known as a distributed lock manager (DLM) coordinates access requests, ensuring compatibility of access rights to resources such as files. The DLM tracks all lock requests, grants and tracks access privileges (locks) to resources, tracks requests for resources not currently available, and grants access privileges (locks) when the resources become available. The DLM keeps an inventory of all these lock requests, and communicates their status to the clients involved.
Generally speaking, for a client to access data in a file, the client first sends a request to the DLM, which performs the functions just described and either grants the lock right away or at a later time when the resource becomes available. Once the client is done with the resource, the lock may be released. The process is repeated each time a client wants to access the resource.
Thus, when a resource is being accessed, a number of messages are sent back-and-forth between the clients and the DLM, which can consume network bandwidth and computational resources and can affect overall performance.
In distributed/shared storage systems, individual files are rarely accessed concurrently. In a corporate environment, for example, users have exclusive use of private folders. Resources in public folders are usually read-only. In general, resources like files are locked when opened but seldom get concurrent access requests from multiple clients. Yet, even if the resource is in a private folder or is read-only by default, a lock request is still sent to the DLM, the request is granted, the lock is then released, and so on. Consequently, bandwidth and computational resources are consumed and performance is affected because the process of requesting, granting, and releasing locks is performed even when no other client is actually able to access or affect the resource.
The demands placed on the DLM become more complicated when the NAS system is shared by clients that use different network protocols such as Network File System (NFS), Server Message Block (SMB), or the like. One client may hold a lock on a resource using one protocol and, if another client that uses another protocol requests access to that resource, then exhaustive validations across multiple parameters are needed to translate and resolve the competing requests. Those validations may result in a state transition such as opportunistic lock (oplock) or lease break and/or lock promotion/demotion. A generic DLM is likely to be incapable of performing such validations.