Client-based name cache handling external to distributed storage system
Name caching can be used external to a distributed file system (DFS), such as a network file system (NFS), to reduce the complexity of facilitating a file operation at the DFS. A system that can use the name caching and request the file operation of the DFS can comprise a processor and a memory that stores executable instructions that, when executed by the processor, facilitate performance of operations. The operations can comprise, in response to a lookup operation or a file operation performed by a DFS, storing, using the processor, a name cache entry for each directory element accessed during the lookup operation or the file operation. The operations further can comprise sending, to the DFS, a single request that comprises a compound command comprising requests for a set of lookup operations and for a file operation.
1 . A system, comprising:
at least one processor; and
at least one memory that stores executable instructions that, when executed by the at least one processor, facilitate performance of operations, comprising:
in response to a first operation, comprising a lookup operation or a file operation, performed by a distributed file system (DFS), caching external to the DFS, using the processor, name cache entries for directory elements accessed during the first operation;
subsequent to the caching, sending, to the DFS, a single request that comprises a compound command comprising requests for:
a set of compounded lookup operations of the lookup operations directed to a group of plural directory elements, of the directory elements, for which the name cache entries are cached external to the DFS, and
a compounded file operation being a same or different operation relative to the first operation,
wherein the sending is performed absent a performance of an omitted operation that would comprise sending, to the DFS, a request for individual lookup operation requests for the plural directory elements of the group of plural directory elements, which were accessed during the first operation, and
wherein instead, the operations further comprise generating, by the system, the single request comprising information regarding plural name cache entries of the name cache entries included in the single request, and wherein the plural name cache entries included in the single request were cached external to the DFS; and
subsequent to the sending of the single request,
receiving a symbolic link from the DFS as a result of execution of the single compound command,
reading the symbolic link and caching, external to the DFS, a name of all directory elements of the symbolic link, and
caching the name of all directory elements referenced in the symbolic link without directly caching the symbolic link.
2 . The system of claim 1 , wherein the operations further comprise:
determining that the name cache entries for all of the plural directory elements to be referenced in the compound command are available external to the DFS in place of sending individual lookup operation requests for all of the directory elements to the DFS.
3 . The system of claim 1 , wherein the operations further comprise:
for a specified directory element of the directory elements accessed during the first operation, including, in the compound command, path data for linking or renaming the specified directory element,
wherein the compound command is requested for a linking operation or renaming operation of the specified directory element.
4 . The system of claim 1 , wherein the operations further comprise:
including, in the set of compounded lookup operation requests, only lookup operation requests for all directory elements in a file name string supplied in a file open at operation request included in the compound command as the compounded file operation request.
5 . The system of claim 1 , wherein the caching of the name cache entries comprises caching, for a specified directory element of the directory elements accessed during the first operation, a reference to a name cache entry of a parent directory element of the specified directory element.
6 . The system of claim 1 , wherein the first operation comprises an application programming interface call or a DFS server request.
7 . The system of claim 1 , wherein the sending of the single request to the DFS absent the performance of the omitted operation is executed other than in response to any delegation from the DFS to cache the name cache entries.
8 . A non-transitory machine-readable medium, comprising executable instructions that, when executed by a processor facilitate performance of operations, comprising:
caching in response to a first operation, the first operation being performed by a distributed file system (DFS), a cache directory for directory elements accessed during the first operation, wherein the caching is performed external to the DFS and comprises plural name cache entries;
generating, using the at least one processor, a single compound command comprising compounded lookup operation requests for a set of all directory elements, of the directory elements accessed during the first operation, along a file path from a file system root up to a file of interest, and the single compound command further comprising a file operation request applicable to the file of interest;
sending, using the at least one processor, the single compound command to the DFS absent a performance of an omitted operation that would comprise sending, to the DFS, a request for individual lookup operation requests for the directory elements along the file path from the file system root up to the file of interest,
generating, using the at least one processor, the single compound command to a kernel API associated with the DFS, the generating comprising employing, using the at least one processor, the cache directory and the plural name cache entries comprised by the cache directory, the employing being performed external to the DFS, and the single compound command comprising information corresponding to the cache directory; and
in response to receiving a symbolic link from the DFS as a result of execution of the single compound command,
reading, using the at least one processor, the symbolic link and caching external to the DFS, using the at least one processor, a name of all directory elements of the symbolic link, and
caching, using the at least one processor, the name of all directory elements referenced in the symbolic link without directly caching the symbolic link.
9 . The non-transitory machine-readable medium of claim 8 , wherein the operations further comprise:
performing, prior to the sending of the single compound command, lookup operations by reading a name cache entry, cached in response to the first operation, external to the DFS for a directory element of the set of all directory elements along the file path.
10 . The non-transitory machine-readable medium of claim 8 , wherein the operations further comprise:
performing lookup operations, using the at least one processor, for all of the directory elements of the set of all directory elements prior to the sending of the single compound command, by reading a set of name cache entries, cached in response to the first operation, for the set of all directory elements, cached external to the DFS.
11 . The non-transitory machine-readable medium of claim 8 , wherein the operations further comprise:
in response to receiving a notification of failure to execute the single compound command from the DFS, deleting, using the at least one processor, a name cache entry, cached in response to the first operation, that is cached external to the DFS.
12 . The non-transitory machine-readable medium of claim 8 , wherein the sending of the single compound command to the DFS absent the performance of the omitted operation is executed, using the at least one processor, without executing in response to any delegation from the DFS to cache the plural name cache entries.
13 . A method, comprising:
caching, by a system operatively coupled to at least one processor, in response to a first operation performed by a network file system (NFS), a cache directory for directory elements accessed during the first operation, wherein the caching is performed external to the NFS, and wherein the cache directory comprises plural name cache entries;
conducting, by the system, a cache lookup external to the NFS, wherein the system is external to the NFS;
generating, by the system, a single request comprising a request for a specified file operation different from the first operation, wherein the single request further comprises a set of compounded lookup operations directed to a group of plural directory elements, of the directory elements cached at the cache directory as the plural name cache entries;
sending, to the NFS, the single request;
based on a result of the conducting of the cache lookup external to the NFS, and based on a communication to the NFS comprising information corresponding to the cache lookup, the communication corresponding to the single request, bypassing sending, to the NFS, a separate lookup operation request, for any of the information corresponding to the cache lookup, including any individual cache lookup request for a directory element of the group of plural directory elements; and
subsequent to the sending of the single request,
receiving a symbolic link from the NFS as a result of execution of the set of compounded lookup operations,
reading the symbolic link and caching, external to the NFS, a name of all directory elements of the symbolic link, and
caching the name of all directory elements referenced in the symbolic link without directly caching the symbolic link.
14 . The method of claim 13 , further comprising:
sending a lookup operation request to the NFS in response to failure of the cache lookup external to the NFS; and
caching a name of a directory element, to which the lookup operation request is directed, external to the NFS.
15 . The method of claim 13 , wherein the conducting the cache lookup is performed without reading any directory handle cached external to the NFS.
16 . The method of claim 13 , further comprising:
determining whether a directory element name returned by the NFS refers to a directory or to a symbolic link.
17 . The method of claim 13 , further comprising:
conducting, by the system, the cache lookup, external to the NFS, for a plurality of directory elements, of the group of plural directory elements, that are to be included in the single request.