Testing Geo-Replicated Aplications - França, Miguel Elias de Sousa (2023)
Geo-replication has been a common technique to provide clients with fast worldwide access to an application. For such large-scale systems, the application’s servers, logic and data are replicated in many geographical locations across different continents. Creating and maintaining geo-replicated applications is challenging and developers often make mistakes due to the complexity of these systems. Software tools and frame- works, such as Jepsen and JepREST, are currently available to assist with the testing process and the correctness of distributed applications. Yet, these tools were not designed to test applications that are spread out in a geo-replicated way without extra effort. For this purpose, we have extended the functionalities of JepREST to support testing geo-replicated applications. This involves the deployment of virtual clients around the world that perform a set of operations simultaneously on the application while producing logs that will be analysed to check if the execution was correct. These clients will attempt to uncover any inconsistencies being made by the application. As they act like real- world clients, detecting anomalies in the behaviour of the application can be deemed unacceptable. That is why it is crucial for an application to be able to maintain its claims of being correct and ensuring data consistency. To accommodate the generated results that are now scattered around the globe we have implemented an algorithm that compiles them into a unified sequence of operations ordered by their time of execution. Since our clients use different clocks, there can be slight discrepancies which can cause operations to be ordered differently than what happened in reality. To address this, we calculate the time gaps between our clients’ clocks and consider these differences in the verification process using a checker algorithm modified to handle such cases. To test the accuracy of this algorithm we built a geo-replicated application and deployed JepREST to test it worldwide. The results show that the algorithm is able to detect anomalies present in the sequences of operations that do not respect causal consistency. We also designed custom histories of operations to test the limits of our algorithm, for which the algorithm was able to correctly output the results.