File Truncation via Snapshot Copy and Asynchronous Block Deallocation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional file systems face challenges in efficiently truncating files, leading to high CPU and I/O resource consumption, long processing times, and potential data inconsistencies due to synchronous locking and extensive metadata updates during delete or truncate operations.
Innovation Solution
The method involves creating an internal snapshot copy of a file, sharing file system blocks between the file and the snapshot, updating metadata to indicate block ownership, and asynchronously deallocating blocks in the background, thereby reducing the number of I/O operations and metadata transactions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If synchronous locking and extensive metadata updates are performed during delete or truncate operations, then data consistency is maintained, but CPU and I/O resource consumption increases significantly
Solution Approach 1:
The system performs preliminary actions by creating a snapshot of the file system before deletion operations and pre-allocating metadata structures. This allows the actual delete/truncate operations to proceed without extensive metadata updates, reducing CPU and I/O consumption while maintaining consistency through the snapshot mechanism.
Solution Approach 2:
The patent introduces an intermediary mechanism (snapshot/replica) that mediates between the delete operation and the actual data structures. Instead of directly updating extensive metadata during deletion, the system uses the snapshot as an intermediary to track changes, significantly reducing resource consumption while preserving data consistency.
2Reliability
If synchronous locking is used during file truncate operations, then locking semantics are maintained, but processing time increases
Solution Approach 1:
The patent extracts the locking mechanism from the critical path of truncate operations. By maintaining locking semantics through metadata updates outside the synchronous operation flow and using snapshots to track state changes, the system preserves correctness while dramatically reducing processing time for truncate operations.
3Reliability
If extensive metadata updates are performed during file deletion, then correct locking semantics are maintained, but the number of I/O operations increases
Solution Approach 1:
The system performs preliminary metadata preparation and snapshot creation before deletion operations. This preliminary action allows the actual deletion to proceed with minimal metadata updates and fewer I/O operations, while still maintaining correct locking semantics through the established snapshot mechanism.
Solution Approach 2:
The patent uses copying by creating snapshots/replicas of the file system state before deletion. Instead of updating extensive metadata during deletion, the system copies the necessary state information into the snapshot and uses reference counting, significantly reducing the number of I/O operations required while preserving locking semantics.
4Quantity of substance
If file blocks are deallocated synchronously during truncate operations, then storage space is reclaimed immediately, but resource consumption and processing time increase
Solution Approach 1:
The patent extracts the block deallocation process from the synchronous truncate operation. By using snapshot-based tracking and reference counting, the system allows truncate operations to complete quickly while block deallocation proceeds asynchronously in the background, reducing resource consumption and processing time while still reclaiming storage space effectively.
Data Source
AI summary
A method is used in managing truncation of files of file systems. A request is received to delete a portion of a file of a file system. A replica of the file is created. The replica represents a state of the file at a particular prior point in time. The replica shares a set of file system blocks of the file with the file. The portion of the file is deleted by updating metadata of the file. The replica of the file is asynchronously deleted in background by de-allocating the set of file system blocks.


