Distributed Data Reading Method Preventing Version Rollback
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In distributed systems, when a terminal reads data from slave nodes before all nodes have completed copying the latest version, it can result in a rollback of the data version, as the earlier version read from one node may be different from the version read from another node.
Innovation Solution
A data reading method where a slave node receives the latest version of target data from the master node, confirms its storage across all nodes using indication information, and only sends the latest version to the terminal after ensuring it has been stored in each node, preventing version rollbacks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If a terminal reads data from slave nodes before all nodes have completed copying the latest version, then data reading speed is improved, but data version consistency deteriorates (version rollback occurs)
Solution Approach 1:
The master node performs preliminary action by sending indication information to slave nodes before allowing data reads. This indication information confirms that the latest version has been copied to all slave nodes, ensuring version consistency before enabling early reads for improved speed.
Solution Approach 2:
Slave nodes provide feedback to the master node by returning the indication information confirming they have stored the latest version. This feedback mechanism allows the system to verify data consistency across all nodes before permitting terminal reads, resolving the contradiction between speed and reliability.
2Reliability
If the master node waits for all slave nodes to complete copying before allowing reads, then data version consistency is improved, but data reading delay increases
Solution Approach 1:
The system performs preliminary action by having slave nodes store the latest version and send indication information to the master node in advance. This allows the master node to know when all nodes are ready before permitting reads, ensuring consistency without unnecessary delays.
Solution Approach 2:
Slave nodes autonomously monitor their own copying status and automatically send indication information to the master node when ready. This self-service mechanism eliminates the need for the master node to continuously query each slave node, reducing communication overhead and reading delays.
3Reliability
If each slave node stores all historical versions of data, then data version consistency is improved, but storage load on each node increases
Solution Approach 1:
The indication information mechanism extracts the essential consistency verification function from storing all historical versions. Slave nodes only need to store the latest version and maintain indication information about their readiness status, eliminating the need to retain all historical versions while still ensuring consistency.
Solution Approach 2:
Instead of storing all historical versions, the system uses copying of the latest version to all slave nodes and tracks this copying status through indication information. This approach maintains consistency by ensuring all nodes have the latest version before reads are permitted, without the storage overhead of keeping all historical versions.
Data Source
Figure 1~2
Figure 3A
Figure 3B
AI summary
This application discloses a data reading method, apparatus, and system, and a distributed system, and belongs to the field of storage technologies. The method includes: receiving a data read request sent by a terminal, where the data read request includes a logical address of target data; locally searching, based on the logical address, a first slave node for a latest version of the target data; and when it is determined that the latest version of the target data has been stored in each of a plurality of slave nodes, sending the latest version of the target data to the terminal. This application can avoid a rollback of a version of read data, and this application applies to data reading.