Home / Companies / TigerBeetle / Blog / July 2023

July 2023 Summaries

3 posts from TigerBeetle

Filter
Month: Year:
Post Summaries Back to Blog
The blog post discusses the utility of LLVM Intermediate Representation (IR) as a powerful tool for software developers to analyze and optimize code beyond the level of source code, particularly in languages like Rust and Zig. By treating LLVM IR as text, developers can bridge the gap between high-level code and low-level machine instructions, allowing for more efficient debugging and optimization, such as reducing unnecessary memory copies. The author provides examples of using LLVM IR to identify implicit memcopies and optimize code in the TigerBeetle project, showing how replacing by-value loops with by-pointer loops can improve performance. The post also describes how the author created a tool named "copyhound" to identify and address these inefficiencies by parsing LLVM IR files. Additionally, the author illustrates how the tool can help track binary size issues caused by function monomorphization, leading to significant reductions in binary size for verbose outputs in TigerBeetle. Through these insights, the post advocates for the practical application of LLVM IR in debugging and optimizing code, highlighting its human-readable format and potential for ad-hoc text processing to uncover code inefficiencies.
Jul 26, 2023 2,951 words in the original blog post.
TigerBeetle is a distributed financial transactions database designed for critical safety, which has now been made accessible through a WebAssembly-compiled simulation in browsers, allowing users to observe how it handles various conditions such as perfect environments, network and process faults, and even extreme storage corruption. The system employs a Deterministic Simulator called the Viewstamped Operation Replicator (VOPR), drawing inspiration from fuzz testing and deterministic simulation methods to uncover and reproduce complex bugs in distributed systems. This simulator can accelerate time, providing significant real-world testing time in a shortened simulation period, while testing TigerBeetle's Viewstamped Replication consensus protocol under different scenarios. The simulation is designed to be engaging and educational, utilizing graphical gaming elements to demonstrate the robustness and recovery capabilities of TigerBeetle under extreme conditions, and is supported by a range of research and development efforts, including contributions from the Zig programming community.
Jul 11, 2023 1,123 words in the original blog post.
TigerBeetle's simulator, VOPR, has undergone a significant update with the introduction of two operational modes: "safety" and "liveness." Previously, the simulator could only test safety properties by randomly injecting faults, such as crashing replicas or corrupting I/O, to ensure strict serializability amidst various system faults. However, this approach was insufficient for identifying liveness issues, such as scenarios where a cluster remains unavailable despite a healthy operating environment. The new "liveness" mode addresses this gap by ensuring that a quorum of replicas can maintain cluster availability, even if other replicas are down or partitioned. By transitioning from safety to liveness mode, the simulator can now simulate permanent asymmetric partitions, ensuring that the core replicas can still process all transactions. This change led to the discovery of a resonance bug involving the repair algorithm and network load balancing, where the round-robin method used for repair requests inadvertently caused a stalemate in log entry recovery. The liveness mode revealed this bug by maintaining the conditions for indefinite replication failure, thus highlighting the importance of this new testing capability.
Jul 06, 2023 994 words in the original blog post.