Virtual File System Cache for Failed File Access
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing virtual file system (VFS) performance during granular level recovery (GLR) is inefficient due to the need for repeated searches on the backup server for files that do not exist, leading to high resource utilization and prolonged recovery times, as the VFS lacks a cache mechanism to handle file access failures efficiently.
Innovation Solution
Implementing a cache in the VFS on the client to store paths of files that fail to open, allowing direct indication of failure without establishing a connection with the backup server, and managing cache entries based on a threshold to remove least recently used files, thereby reducing unnecessary searches and resource expenditure.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the VFS searches the backup server for every file access request, then file access completeness is improved, but resource utilization increases and recovery time prolongs
Solution Approach 1:
The system performs preliminary actions by caching file access results (both successful and failed openings) in the VFS before actual file access operations are needed. When a file access request comes in, the VFS first checks the cache to see if the result is already known, avoiding unnecessary backup server connections. This preliminary caching of access outcomes directly resolves the contradiction by preparing information in advance that prevents repeated expensive server searches.
Solution Approach 2:
The VFS acts as an intermediary layer between the application and the backup server. It introduces a cache mechanism that mediates file access requests by intercepting them first, checking the cache for previous results, and only forwarding requests to the backup server when necessary. This intermediary cache layer reduces direct communication overhead with the backup server while maintaining access completeness, thereby resolving the contradiction between reliability and productivity.
2Loss of information
If the VFS connects to the backup server for each file access, then accurate file availability information is obtained, but network resources and server load increase
Solution Approach 1:
The VFS creates copies of file access results and stores them in the cache instead of repeatedly querying the backup server. Each cache entry is a copy of the access outcome (success or failure) that can be reused multiple times. This copying approach maintains accurate file availability information by preserving the original server response while avoiding repeated network transactions, thus resolving the contradiction between information accuracy and resource consumption.
Solution Approach 2:
The system performs preliminary actions by pre-caching file access results before actual file operations are needed. The VFS proactively stores access outcomes in the cache during initial operations, so subsequent requests can be satisfied from the cache without network communication. This preliminary caching ensures accurate file availability information is available while dramatically reducing network resource consumption.
3Speed
If the cache stores all file paths, then file access speed improves, but cache memory consumption increases
Solution Approach 1:
The VFS implements a cache eviction policy that discards less frequently accessed cache entries when the cache reaches capacity. By selectively removing old or rarely used file path entries, the system makes room for new cache entries while maintaining the most valuable access information. This discarding mechanism allows the cache to maintain high file access speed for frequently accessed files while preventing unbounded memory consumption.
Solution Approach 2:
The system changes parameters by dynamically adjusting cache management based on usage patterns. Instead of storing all file paths indefinitely, the VFS modifies the cache contents by removing entries that exceed capacity thresholds or have not been accessed recently. This parameter change in cache composition maintains fast access speed for active files while controlling overall memory usage through selective retention and removal of cache entries.
Data Source
AI summary
Embodiments of the present disclosure provide a method, device and computer readable medium for accessing a file. The method described herein comprises: receiving, in a virtual file system on a client, a request for opening a file in the virtual file system from an application, the request comprising a path for the file; determining whether the file has been opened successfully at the client; in response to determining that the file fails to be opened at the client, searching a first cache of the virtual file system for the path, the first cache being configured to store paths for files that fail to be opened at the client; and in response to success in finding the path in the first cache, returning an indication of failure in opening the file to the application.


