Flash Memory Distributed Transaction Processing via Shadow Mapping
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Distributed transaction processing in flash memory faces inefficiencies due to excessive log writing, high communication overheads, and the two-phase commit protocol's blocking nature, which increases time and space overheads and complicates failure recovery.
Innovation Solution
A method that internalizes two-phase commit state logs as flash memory metadata operations, uses a shadow mapping table to store temporary data, and modifies the FTL mapping table for version transformation, reducing the need for frequent log writing and improving performance by minimizing state recording and recovery overheads.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the two-phase commit protocol is used for distributed transaction processing, then transaction atomicity and consistency are ensured, but communication overheads and time overheads increase significantly
Solution Approach 1:
The patent extracts the state log recording function from the traditional two-phase commit protocol and implements it using flash memory's out-of-place update capability. Transaction state information is directly recorded in flash memory pages rather than through repeated communication rounds, eliminating the time overhead of multiple protocol messages while maintaining atomicity guarantees.
Solution Approach 2:
The patent uses shadow paging to create copies of transaction data pages. Shadow pages store temporary transaction data during the prepare phase, and upon commit, the shadow pages are atomically swapped with the original pages. This copying mechanism eliminates the need for repeated state log writing and communication, reducing time overhead while ensuring transaction atomicity.
2Reliability
If state logs are written multiple times during two-phase commit, then transaction state is recorded reliably, but space overhead and write overhead increase
Solution Approach 1:
The patent extracts the state log function from traditional logging mechanisms and integrates it directly into flash memory page structures. Transaction state information is embedded in the flash memory pages themselves rather than being stored separately in log files, eliminating redundant space usage while maintaining reliable state recording through flash memory's inherent durability.
Solution Approach 2:
The patent makes flash memory pages serve multiple functions: they store both transaction data and transaction state information simultaneously. The page metadata includes transaction identifiers and state flags, allowing a single page structure to fulfill both data storage and state logging roles, thereby reducing space overhead compared to separate log files.
3Reliability
If shadow version updates are performed frequently, then temporary data is managed correctly, but operation overheads increase
Solution Approach 1:
The patent allocates shadow pages in advance before transactions begin. These pre-allocated shadow pages are ready to receive temporary transaction data immediately, eliminating the overhead of dynamic allocation during transaction execution. The shadow paging structure is prepared beforehand, allowing rapid switching between original and shadow pages during commit operations.
Solution Approach 2:
The patent implements shadow paging where shadow pages are created as copies of original pages before transaction execution. This copying approach allows the system to manage temporary data efficiently by simply switching between page references rather than performing frequent data copying operations, thereby reducing operation overhead while maintaining data integrity.
4Reliability
If the FTL mapping table is updated frequently, then address mapping is kept current, but flash memory write performance degrades
Solution Approach 1:
The patent performs FTL mapping table updates in advance during garbage collection operations rather than immediately upon each page allocation. By proactively updating the mapping table during low-activity periods, the system maintains accurate address mapping while minimizing the impact on write performance, as updates are batched rather than performed individually for each operation.
Solution Approach 2:
The patent implements periodic updates of the FTL mapping table during garbage collection cycles rather than continuous updates. This periodic approach allows the mapping table to be updated in batches at scheduled intervals, maintaining mapping accuracy while avoiding the performance degradation that would result from updating the mapping table with every single page operation.
Data Source
AI summary
The present invention discloses a method for distributed transaction processing in a flash memory, including the following steps: S1. performing two-phase commit on a transaction, removing a state log record of a two-phase commit protocol, and internalizing as an operation on flash memory metadata in a transaction interface; S2. storing a temporary data object as a shadow version while performing the transaction, using a shadow mapping table to store the address of the shadow version or a state of a page, using page metadata to record transaction information, using a transaction metadata page to record a transaction state, and using a transaction state table to record an address of the transaction metadata page; and S3. when the coordinator or a participant fails, recovering the FTL mapping table, shadow mapping table, and transaction state table with the help of stored data and flash memory metadata. The present invention has the following advantages: the number of logs is reduced, and performance of transaction processing in a distributed flash memory environment is improved.


