A method for analyzing replica staleness in a periodic replication system

By introducing mathematical modeling methods for t-visibility, k-staleness, and t-staleness indices into periodic replication systems, the problems of high cost and poor understandability in existing technologies are solved. This enables efficient quantification of replica obsolescence and comparison of synchronization strategies, meeting the needs of different applications.

CN116010223BActive Publication Date: 2026-11-20BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211284409.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-17
Publication Date
2026-11-20
Estimated Expiration
2042-10-17

AI Technical Summary

Technical Problem

Existing methods for measuring replica obsolescence suffer from high costs, poor interpretability, and a lack of theoretical models in periodic replication systems, making it difficult to effectively analyze the system's operating mechanism and compare the superiority of different synchronization strategies.

Method used

A mathematical modeling-based method is proposed to quantify the staleness of replicas in a periodic replication system using three staleness indices: t-visibility, k-staleness, and t-staleness. Taking into account system workload and synchronization cycle, a unified measurement standard is established to analyze the staleness of follower nodes in different geographical locations.

Benefits of technology

It enables efficient quantification of replica obsolescence in periodic replication systems, reduces costs, improves system understandability, allows comparison of the effects of different synchronization strategies, and meets application requirements with varying obsolescence tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010223B_ABST
    Figure CN116010223B_ABST
Patent Text Reader

Abstract

A copy staleness quantification analysis model for a periodic replication system is characterized by establishing an analysis model for quantifying three staleness indexes of t-visibility, k-staleness and t-staleness for the periodic replication system, deriving expressions of the indexes according to workloads and synchronization periods of the system, and theoretically analyzing copy staleness of the system; a unified measurement standard is established for the indexes, and the staleness degree in a period is considered fairly, so that different synchronization strategies can be compared; in the case of dynamic data change, and by considering write delays of follower nodes in different geographical locations, the practicability of the model is improved. The application has good practicability and theoreticality, can analyze copy staleness of follower nodes in different geographical locations according to actual workloads and system synchronization configurations, provides staleness quantification results for analyzing and optimizing a storage system, and meets application requirements with different staleness tolerances.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention discloses a method for quantifying and analyzing replica obsolescence in periodically replicated systems, addressing the challenges faced by wide-area distributed storage systems, and belonging to the field of computer technology. Background Technology

[0002] Periodic replication is one of the methods used in modern distributed systems to reduce the overhead of consistency maintenance, and it is a commonly adopted approach. These systems typically employ leader-based replication (also known as active / passive or master / slave replication). The system only allows writes to the leader node. Each write request carries a globally incrementing version number and a write timestamp from the leader node. Write requests are periodically transmitted to follower nodes via the leader's multicast mechanism or by the followers' pull mechanism, and updates are committed, ensuring linear consistency of global writes. This replication method is widely deployed and used in widely distributed systems due to the strong consistency and high availability of the leader node, as well as the low cost of periodic replication, such as HDFS, Lustre, GlusterFS, and MongoDB. In these systems, the leader and follower nodes eventually become consistent without subsequent updates. However, distributed systems typically operate in environments where data changes dynamically, and due to the high network latency between the leader and followers, as well as the latency of lazy replication, local replicas cannot provide consistent data, leading to issues related to replica staleness. Without quantifying data staleness, it's difficult to analyze the impact of different system designs on consistency behavior, compare the superiority of weaker consistency, or achieve fine-grained trade-offs between consistency and other system metrics (such as latency and throughput). Furthermore, different applications have varying tolerances for data staleness; for example, weather forecast applications can tolerate data outdated within 15 minutes, while online ticketing applications require the latest data. To achieve these goals, the following problem needs to be addressed: how to quantify replica staleness in eventually consistent systems. Current research methods for quantifying replica staleness can be divided into measurement-based methods and model-based methods.

[0003] Measurement-based methods typically treat the system as a "black box," ignoring internal settings and configurations, and benchmark the system. These benchmarks generate or synthesize a workload, collect global trace information, and then measure inconsistencies within that global trace. Haonan Lu et al. proposed φ(P)-consistency and φ(S:P)-consistency to theoretically analyze anomalies caused by weak consistency, and designed and implemented a trace collector and consistency checker for real-time monitoring of the operational status of different replicas. Based on this, they tracked and analyzed real-world load data from Facebook's TAO system, finding that the system had only 0.0004% inconsistent reads. Chenhao Huang et al. benchmarked MongoDB, including 2200 measurements, totaling 110,000,000 reads and 63,800 writes, to observe the probability of inconsistent reads between minor and most recent replicas. Polygraph is a benchmarking program that, without setting a specific load, combines with existing benchmarks (TPC-C, SEATS, TATP, YCSB, and BG) to quantify the number of consistency anomalies in an application. These works quantify staleness by using the proportion or number of consistency-abnormal operations as an indicator, which only roughly quantifies the amount of inconsistency observed by users in the system and cannot measure how stale the data read by users is relative to the latest data. Therefore, many works have proposed or adopted more granular staleness indicators to address this problem. Rahman et al. introduced the concept of t-freshness: data read is considered fresh if it is the most recently written data or the write time is less than t seconds. Based on this indicator, they studied the trade-off between consistency and performance in quorum-replication-based distributed systems. They used PID and multiplicative control methods to inject 3000 operation logs in each iteration to quantify the current staleness, adjusting adaptive control parameters to meet consistency and latency requirements. This is a trial-and-error approach, but in real-world environments, multiplicative control loops are prone to oscillation and difficulty converging to the target state. Golab et al. quantified the staleness of returned data from two perspectives: time-based staleness and operation count-based staleness. Golab also proposed a tracking analysis method and a new consistency metric for detecting the frequency and severity of consistency anomalies. Consistency. Measurement-based methods can effectively quantify certain inconsistencies by benchmarking various storage systems and then passively analyzing historical operation logs. However, the volume of historical operation logs is typically enormous, generating hundreds of gigabytes or even terabytes of files daily; secondly, these methods treat the system as a "black box," failing to effectively understand its operational mechanisms. Therefore, measurement-based methods remain limited in terms of cost and interpretability.

[0004] Model-based approaches aim to theoretically analyze and quantify the consistency behavior of systems, establishing mathematical models for different systems or obsoleteness metrics to analyze obsoleteness at a theoretical level. The PBS model is the most relevant work for quantifying obsoleteness in weakly consistent systems. This pioneering work addresses two important issues in some quorum systems: the timing and reasons why eventually consistent systems return obsolete data, and how to quantify the obsoleteness of the returned data. PBS proposes two metrics for measuring obsoleteness: t-visibility and k-staleness; the former predicts the probability of reading obsolete values ​​within a certain time unit after a single write operation, while the latter answers the question of the obsoleteness of the read data. The probability within a version range. PBS predicts the latency between the coordinator and replicas based on the WARS model, and then based on the formula... To predict t-visibility and k-staleness, N is the total number of nodes in the system, W is the write quorum size, and R is the read quorum size. PGC further improves upon this, better predicting the probability of reading stale values. Another widely used staleness metric is the information age metric AOI, defined as the time elapsed since the last update. As an important indicator for studying data freshness, it has been used in many subsequent works to study replica freshness in data replication systems. Jing Zhong et al. studied the data freshness of read quorum in a distributed system based on quorum replication and derived an age-optimized write quorum size. Behrouzi-Far et al. studied the relationship between the number of leaders and the size of read queries in a leader-based replication system and the freshness of retrieved data, and found the optimal number of leaders that minimizes the average age of retrieved data. Another work by Jing Zhong quantified the AOI and AOS metrics in a cache refresh system scenario with multiple data update sources and a single local server. However, it ignored the write latency in real-world scenarios, which can be very high in geographically distributed storage systems. Furthermore, in caching scenarios, local servers need to connect to different data sources to update their cached data items, while in periodic replication systems, local replicas store full copies, which are periodically synchronized by the leader node. Harmony can adaptively adjust the consistency level at runtime according to application requirements. Assuming the system workload follows a Poisson distribution, Harmony designs an intelligent estimation model for stale reads in quorum-replicated systems, allowing for flexible increases or decreases in the size of read quorums to maintain a low proportion of stale reads. PAB, on the other hand, proposes a fast read algorithm for quorum-replicated systems with near-strong consistency. By converting stale reads into read-inverted and write-inverted modes, it quantifies the data staleness limits and probability under this consistency maintenance algorithm.

[0005] The main problems with existing methods for quantifying copy obsolescence are:

[0006] Measurement-based methods benchmark various storage systems and then passively analyze historical operation logs to quantify certain inconsistencies. However, the volume of system historical operation logs is typically enormous, generating hundreds of gigabytes or even terabytes of files daily. Furthermore, these methods treat the system as a "black box," failing to effectively understand its operational mechanisms. Therefore, measurement-based methods remain limited in terms of cost and interpretability.

[0007] Model-based methods primarily focus on quorum-based replication systems, lacking models for periodic replication systems. First, quorum-based replication systems differ fundamentally from the system addressed in this invention. The probability of a user accessing the latest write is determined by replication parameters N, W, and R. In periodic replication systems, the staleness of data retrieved by a user depends mainly on the type of node accessed and the frequency of consistency maintenance. Second, works such as PBS and PGC show that under static data conditions, systems typically maintain consistency after a short period. However, in actual system operation, data items are usually updated continuously and concurrently. Therefore, dynamic changes in these data during the synchronization cycle can still cause inconsistencies among replicas, and their staleness changes with the accumulation of updates. Furthermore, the staleness of follower nodes may change over time, potentially being 3 at the initial stage of the synchronization cycle and 15 at another point. To compare different synchronization strategies, a unified metric needs to be established to fairly consider staleness over a period or cycle, rather than just at a single moment.

[0008] In summary, these methods are not suitable for analyzing periodically replicated systems. There is a need to research a quantitative analysis method for replica obsolescence in periodically replicated systems, which can provide quantitative results of obsolescence for the trade-off between consistency and other performance indicators of distributed storage systems, while meeting the application requirements with different obsolescence tolerances. Summary of the Invention

[0009] The main objective of this invention is to provide a quantitative analysis method for replica staleness / freshness in periodic replication systems. Addressing the issue of replica staleness measurement in periodic replication systems, this invention proposes quantitative analysis models for t-visibility, k-staleness, and t-staleness staleness indices, theoretically quantifying the replica staleness of the system.

[0010] The technical solution of this invention is:

[0011] A method for quantifying replica staleness in periodically replicated systems is characterized by establishing analytical models for three staleness indices—t-visibility, k-staleness, and t-staleness—based on the system's workload and synchronization cycle, and deriving expressions for these indices. This allows for theoretical analysis of system replica staleness. A unified measurement standard is established for these indices, fairly considering staleness within a cycle, and can be used to compare different synchronization strategies. In cases of dynamic data changes, the write latency of follower nodes in different geographical locations is taken into account to quantify the indices, thereby improving the model's practicality. This invention possesses both strong theoretical and practical value, enabling the analysis of replica staleness of follower nodes in different geographical locations based on actual operating conditions and system configuration. It provides staleness quantification results for analyzing and optimizing storage systems, while simultaneously meeting the application requirements with varying staleness tolerances.

[0012] The steps are as follows:

[0013] 1) Develop a model to represent the obsolescence of copies in a periodic replication system;

[0014] 2) Before performing replica staleness analysis, each follower node collects update information from all operation logs of all nodes as much as possible to provide a basis for obtaining the write latency distribution of the follower node to the leader node.

[0015] 3) Analyze the changes in replica staleness of follower nodes based on the update process of the leader node, and then draw the change curves of the three staleness indicators of follower nodes, which can provide a detailed and intuitive analysis of the staleness change process of each follower node.

[0016] 4) Based on the change curves of the three obsolescence indices of each follower node, derive the expressions for the three obsolescence indices. These expressions can provide the average obsolescence metric of each follower node under different loads and system synchronous configurations.

[0017] Step 1) includes the following steps:

[0018] Step (1.1) assigns each data item of the leader node (denoted as...) The external update process of is modeled as a Poisson process (the update rate is denoted as ). The leader node periodically sends data to the follower nodes (different follower nodes are represented by variables). (This indicates) sending an incremental update snapshot request (the update period is denoted as ). (Deadline) The number of times a follower node refreshes its local copy is denoted as . ;

[0019] Step (1.2) The time at which the leader node starts transmitting data each time is determined by a variable. This indicates that the time when a follower node receives data from the leader node is represented by a variable. Indicated by random variables Represents the leader node to follower node The write time of the sending-receiving process is represented by a variable. Indicates the version number written;

[0020] Step (1.3) The latest write to the local replica of the follower node (denoted as...) The time of the write obtained on the leader node (denoted as ) ), The earliest update of the leader node since the follower node last refreshed its local copy (denoted as ); The time when the leader node writes (denoted as ) ), The earliest update on the leader node since the follower nodes last refreshed their local replicas is the version number written to the leader node (denoted as ); ), The latest version number written to the local replica of the follower node (denoted as ). ), ;

[0021] Step (1.4) defines the formal expressions for three indices—t-freshness, t-visibility, and k-staleness—in a periodic replication system. t-freshness (denoted as t-visibility) ), t-visibility (denoted as ), k-staleness (noted as) ), .

[0022] Step 2) includes the following steps:

[0023] Step (2.1) When establishing the quantitative analysis model, it is necessary to consider the write latency of follower nodes in different geographical locations, collect the write logs of the leader node and all follower nodes, record the write latency distribution between the leader and followers, and thus calculate the average write latency of the follower nodes. ;

[0024] Step 3) includes the following steps:

[0025] Step (3.1) The process of receiving write requests by the leader node is represented by a Poisson distribution, which is used as a reference for the staleness of follower replicas under the leader's update process;

[0026] Step (3.2) Changes in the follower node's t-freshness metric, at the time each follower node receives a synchronization request. t-freshness becomes the stale value of the most recently written value. Then it increases linearly until the next synchronization request arrives at the specified time. Reset to the latest written stale value;

[0027] Step (3.3) Changes in the t-visibility metric of follower nodes, at the time each follower node receives a synchronization request. The t-visibility is 0, and it remains until the leader node receives the latest write; once the leader node receives the write request... When follower nodes and leader nodes lose synchronization, t-visibility becomes the distance between the moment the leader and follower nodes lose synchronization and the moment they synchronize. Then it decreases linearly until it reaches the synchronization point. Reset to 0;

[0028] Step (3.4) Changes in the k-staleness metric of follower nodes, at the time each follower node receives a synchronization request. The k-staleness is 0 and remains so until the leader node receives the latest write. Once the leader node produces an update, and the follower nodes lose synchronization with the leader node, the k-staleness becomes the number of times the follower node's data lags behind the leader node's updates. With each update, the k-staleness increments by 1 until the synchronization point. Reset to 0;

[0029] Step (3.5) Based on the changes in the three obsolescence indicators of the follower nodes, plot the curves of the three indicators;

[0030] Step 4) includes the following steps:

[0031] Step (4.1) After the curves of the three indicators are determined, the average value of each indicator is calculated based on the image. The average value of each indicator is the ratio of the average area under the curve of that indicator to the average length of the period within a single period.

[0032] Step (4.2) Follower Nodes Data Items The average t-freshness is

[0033] Step (4.3) Follower Nodes Data Items The average t-visibility is

[0034] Step (4.4) Follower Nodes Data Items The average k-staleness is

[0035] The main advantages of the quantitative analysis method for replica obsolescence in periodic replication systems proposed in this invention compared with existing technologies are:

[0036] The quantitative analysis model for the three obsolescence indices t-freshness, t-visibility, and k-staleness proposed in this invention adopts a completely mathematical modeling method, which has good theoretical and practical value. It can reduce the cost of measuring replica obsolescence through system benchmarking, and at the same time, it is easy to understand the impact of different system synchronization configurations and workloads on data obsolescence, thus improving the system's understandability. A unified measurement standard is used for each obsolescence index, which can be used to compare different synchronization strategies. The model assumes dynamic data changes and takes into account the write latency of follower nodes in different geographical locations, thereby improving its practicality. Attached Figure Description

[0037] Figure 1 A flowchart illustrating the implementation of a method for quantifying copy obsolescence in a periodic replication system.

[0038] Figure 2 This is a diagram of the system architecture for periodic replication.

[0039] Figure 3 This is a graph showing the change in the t-freshness index.

[0040] Figure 3-1 This is a schematic diagram illustrating the calculation of the t-freshness index.

[0041] Figure 4 This is a graph showing the change in the t-visibility obsolescence index.

[0042] Figure 5 This is a graph showing the change in the k-staleness index. Detailed Implementation

[0043] The present invention will be further described in detail below with reference to the accompanying drawings.

[0044] like Figure 1 The diagram shown is a flowchart of the implementation of this invention. A method for quantifying copy obsolescence in a periodic replication system includes the following steps:

[0045] 1) Establish a replica obsolescence model for a periodic replication system, including the mathematical modeling process of the system and the formal expression of obsolescence indices;

[0046] 2) Before performing replica staleness analysis, each follower node should collect update information from the current node's write operation log as much as possible, and combine it with the leader node's write operation log to calculate the average write latency of each follower node.

[0047] 3) Using the update process of the leader node as a reference, and based on the formal expression of the three obsolescence indices, plot the change curves of the three obsolescence indices of the follower nodes. These curves can provide a detailed and intuitive analysis of the obsolescence change process of each follower node.

[0048] 4) Based on the change curves of the three obsoleteness indicators for each follower node, the average value of each indicator is calculated from the graph. The average value of each indicator is the ratio of the average area under the curve of that indicator to the average length of the cycle within a single period, thereby deriving the expressions for the three obsoleteness indicators. These expressions can provide the average obsoleteness measurement results for each follower node under different loads and system synchronization configurations.

[0049] Periodic replication system architecture such as Figure 2 As shown, this is a commonly used approach. In this system, writes are only allowed on the leader node. Each write request carries a globally incrementing version number of the leader node and a write timestamp. Write requests are periodically transmitted to follower nodes via multicast or follower pulls, and updates are committed to ensure linear consistency of global writes. Because the leader and follower nodes update asynchronously, once the leader node receives an update, the data copy on the follower node becomes outdated. To keep the local copies on the follower nodes fresh or consistent, the follower nodes periodically fetch incremental updates from the leader node. Without updates, the leader and follower nodes will eventually converge to a consistent state. When reading, clients accessing the leader node will obtain the latest updates, but the response time between the client and the leader node is relatively high. Therefore, clients can access follower nodes to obtain data, trading data freshness for a lower response time.

[0050] The change process of the follower node t-freshness index is as follows: Figure 3 As shown, the time when each follower node receives the synchronization request. t-freshness becomes the stale value of the most recently written value. Then it increases linearly until the next synchronization request arrives at the specified time. Resetting to the most recently written stale value specifically includes the steps of deriving the average t-freshness:

[0051] 1) Average t-freshness can be obtained through Figure 3-1 The area under the t-freshness evolution curves shown is added together to calculate the area within each cycle. It can be decomposed into the area of ​​a parallelogram. and trapezoidal area By calculating the graph, we can obtain:

[0052] 2) Define a geometrically distributed random variable. , indicating the first The first received packet and the first The number of synchronization intervals experienced between them. Probability of failure ,here ,

[0053] 3) Calculate the area of ​​the trapezoid : and the area of ​​a parallelogram :

[0054] 4) Calculate the area of ​​the parallelogram. and trapezoidal area The average area, ,therefore ,

[0055] 5) Combining the above steps, we can obtain...

[0056] 6) Calculation

[0057] 7) Combining the above steps, we can obtain...

[0058] The change process of the follower node t-visibility obsolescence index is as follows: Figure 4 As shown, the time when each follower node receives the synchronization request. The t-visibility is 0, and it remains until the leader node receives the latest write; once the leader node receives the write request... When follower nodes and leader nodes lose synchronization, t-visibility becomes the distance between the moment the leader and follower nodes lose synchronization and the moment they synchronize. Then it decreases linearly until it reaches the synchronization point. Resetting to 0 specifically includes the steps of deriving the average t-visibility:

[0059] 1) Examples of changes in average t-visibility include... Figure 4 As shown, the area within each period It can be represented as a triangle The area, define a random variable. Indicates the leader's initial update Between to the start synchronization point The time interval can be obtained .

[0060] 2) The average t-visibility can be calculated by the area under the t-visibility evolution curve, which can be obtained through calculations on the graph. The change process of the follower node k-staleness index is as follows: Figure 5 As shown, the time when each follower node receives the synchronization request. The k-staleness is 0 and remains so until the leader node receives the latest write. Once the leader node produces an update, and the follower nodes lose synchronization with the leader node, the k-staleness becomes the number of times the follower node's data lags behind the leader node's updates. With each update, the k-staleness increments by 1 until the synchronization point. Resetting to 0 specifically includes the steps for deriving the average k-staleness:

[0061] 1) Examples of changes in average k-staleness include: Figure 5 As shown, the area within each period Can be represented as a rectangle and polygons The area, define a random variable Represents a rectangle of high,

[0062] 2) The average t-visibility can be calculated by the area under the k-staleness evolution curve, which can be obtained through graphical calculations.

[0063] 3) Calculate the rectangle's... area,

[0064] 4) Calculation

[0065] 5) Calculate the polygon's... area,

[0066] 6) Combining the above steps, we can obtain...

[0067] Finally, it should be noted that the present invention can also have many other applications. Without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and modifications according to the present invention, but these corresponding changes and modifications should all fall within the protection scope of the present invention.

Claims

1. A method for quantitative analysis of copy obsolescence in periodically replicated systems, characterized in that, Includes the following steps: Each data item of the leader node The external update process is modeled as a Poisson process, and the update rate is denoted as . The leader node periodically sends incremental update snapshot requests to the follower nodes, where different follower nodes use variables. The update cycle is denoted as . Deadline The number of times a follower node refreshes its local copy is denoted as . ; The time at which the leader node starts transmitting data each time is used as a variable. This indicates that the time when a follower node receives data from the leader node is represented by a variable. Indicated by random variables Represents the leader node to follower node The write time of the send-receive process is represented by a variable. Indicates the version number written; The latest write to the local replica of the follower node The time of the write operation obtained on the leader node is denoted as... , ; The earliest update of the leader node since the follower nodes last refreshed their local replicas. The time of writing to the leader node is denoted as . , ; The earliest update on the leader node since the last local copy refresh is recorded as the version number written on the leader node. , The latest version number written to the local replica of the follower node is denoted as . , ; Define a periodic replication system , , Formal representation of the three indicators. Recorded as , ; Recorded as , ; Recorded as ), ; When building a quantitative analysis model, it is necessary to consider the write latency of follower nodes in different geographical locations, collect write logs of the leader node and all follower nodes, record the write latency distribution between the leader and followers, and calculate the average write latency of the follower nodes. ; The write request process received by the leader node is represented by a Poisson distribution, which serves as a reference for the staleness of follower replicas during the leader's update process. follower nodes The change in the metric occurs at the time each follower node receives a synchronization request. , Become the latest written stale value Then it increases linearly until the next synchronization request arrives at time point A. n+1 Reset to the latest written stale value; follower nodes The change in the metric occurs at the time each follower node receives a synchronization request. , Set to 0 and maintain this value until the leader node receives the latest write; once the leader node receives the write request... The follower nodes and the leader node lost synchronization. The distance A between the leader node and the follower node losing synchronization and the synchronization time becomes the leader node. n+1 -w e Then it decreases linearly until it reaches the synchronization point. Reset to 0; follower nodes The change in the metric occurs at the time each follower node receives a synchronization request. The k-staleness is 0, and it remains so until the leader node receives the latest write; once the leader node produces an update, the follower nodes lose synchronization with the leader node. Follower nodes become less frequent than the leader nodes in terms of data updates; each update... Increment by 1 until the synchronization point is reached. Reset to 0; Based on the changes in the three obsolescence indicators of the follower nodes, plot the curves of the three indicators. Based on the curves of the three metrics, expressions for the three obsolete metrics are derived. These expressions provide the average obsolete metric for each follower node under different loads and system synchronization configurations, including the following steps: Once the curves of the three indicators are determined, the average value of each indicator is calculated based on the graphs. The average value of each indicator is the ratio of the average area under the curve of that indicator to the average length of the cycle within a single period. follower nodes Data Items average for , follower nodes Data Items average for , follower nodes Data Items average for .