Multi-Replica Data Restoration in Distributed Databases
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In distributed databases, data restoration from multi-replica data is time-consuming and inefficient, leading to prolonged downtime and increased storage pressure due to the accumulation of large transaction logs.
Innovation Solution
A method where a faulty node in a distributed database identifies the latest replica data from a non-faulty node based on log sequence numbers (LSNs) to perform data restoration, eliminating the need for retaining transaction logs and reducing storage pressure.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If log replay is performed from the fault source according to accumulated data transaction logs to restore faulty replica data, then data restoration can be achieved, but data restoration time becomes very long and data restoration efficiency is low
Solution Approach 1:
The patent applies preliminary action by pre-generating and storing incremental difference data (shadow data) that captures changes between replica data versions. When a fault occurs, this pre-computed shadow data can be directly applied to restore the faulty replica without performing time-consuming log replay operations, thus significantly reducing data restoration time while maintaining restoration capability
Solution Approach 2:
The patent extracts only the essential restoration information (shadow data representing data changes) from the complete transaction log sequence. Instead of replaying all transaction logs from the fault source, the system extracts and stores incremental difference data that can be directly applied to restore faulty replicas, eliminating the need for lengthy log replay processes
2Reliability
If a large quantity of data transaction logs are retained to enable fault recovery, then data restoration can be performed, but storage space of the database system is heavily occupied and storage pressure increases
Solution Approach 1:
The patent extracts only the essential restoration information (shadow data) from complete transaction logs. Instead of retaining all transaction logs, the system extracts incremental difference data representing changes between replica versions, stores this compressed shadow data, and uses it for restoration. This dramatically reduces the storage volume required for fault recovery while maintaining full recovery capability
Solution Approach 2:
The patent changes the parameter representation from storing complete transaction logs (large volume) to storing incremental shadow data (small volume). By transforming the restoration mechanism to use compact difference data instead of full transaction logs, the system achieves the same fault recovery function with significantly reduced storage requirements
Data Source
AI summary
Embodiments of this application provide a method and an apparatus for multi-replica data restoration. The method is applied to a distributed database and includes: when a first page in replica data of a first node has a fault, obtain N latest LSNs in data log information of a second node that corresponds to a first page identifier. The first page is any page that is in the replica data of the first node and that has a fault. The first node further determines a node corresponding to a largest LSN in the N latest LSNs in the data log information of the second node that corresponds to the first page identifier is a third node. Then the first node performs data restoration on the first page in the replica data of the first node according to replica data of the third node.


