FLAC: Practical Failure-Aware Atomic Commit Protocol for Distributed Transactions

Hexiang Pan, Quang-Trung Ta, Meihui Zhang, Yeow Meng Chee, Gang Chen, Beng Chin OoiarXiv 2023 · DOI

Abstract

Atomic Commit Protocols (ACPs) are essential for maintaining data consistency in distributed systems but often suffer from either blocking under failures or high overhead during normal operation. We present FLAC (Failure-Aware Atomic Commit), a novel protocol that dynamically adapts to environmental conditions. By employing a reinforcement learning-tuned state machine to transition between three optimized sub-protocols—$FLAC_{FF}$, $FLAC_{CF}$, and $FLAC_{NF}$—FLAC achieves significant performance gains. Experimental results demonstrate up to 2.22x higher throughput and 2.82x lower latency compared to traditional 2PC and 3PC protocols.

Introduction

In distributed databases, ensuring atomicity—where a transaction either commits entirely or not at all—is a fundamental requirement. The industry-standard Two-Phase Commit (2PC) is efficient but vulnerable to blocking if a coordinator or participant fails. Conversely, Three-Phase Commit (3PC) and protocols like Easy Commit avoid blocking but introduce a significant "pessimism tax" through additional message rounds, even in healthy environments.

Existing ACPs typically operate under fixed assumptions about system reliability. FLAC addresses this by providing a protocol that monitors the environment in real-time and switches between robustness levels to balance performance and fault tolerance.

The FLAC Architecture

FLAC is designed around a coordinator-participant model, integrated with a specialized management layer to handle environmental adaptation.

Figure 1: The FLAC system architecture, featuring the Coordinator node with its RLSM Manager and the set of Participants.

The core components include:

  1. Three Robustness Levels:
  2. $FLAC_{FF}$ (Failure-Free): Optimized for ideal conditions with minimal message delays.
  3. $FLAC_{CF}$ (Crash-Failure): Designed for stable networks where nodes may crash.
  4. $FLAC_{NF}$ (Network-Failure): A highly robust level based on "Easy Commit" to handle both crashes and network partitions.
  5. Robustness-Level State Machine (RLSM): Residing in the coordinator, the RLSM monitors transaction outcomes. It "upgrades" nodes to more stringent levels upon detecting failures.
  6. Reinforcement Learning (RL) Tuning: To optimize the "downgrade" process (returning to faster protocols), FLAC uses Q-learning. This allows the system to learn the optimal threshold of successful transactions required before safely reducing robustness.

Failure-Aware Transitions

The heart of FLAC's adaptivity is its state machine, which manages transitions between robustness levels based on observed system behavior.

Figure 5: The Robustness-Level State Machine (RLSM) showing transitions between Failure-free ($L_{FF}$), Crash-failure ($L_{CF}$), and Network-failure ($L_{NF}$) levels.

FLAC employs a "lazy upgrade" strategy, increasing robustness only when a transaction-blocking failure is explicitly detected. Downgrades are managed by the RL component to prevent premature transitions that could lead to blocking in unstable environments.

Evaluation and Results

FLAC was evaluated using a prototype distributed key-value store with YCSB and TPC-C benchmarks. Failure scenarios were simulated by injecting node crashes and network delays.

Key findings include:

  • Performance: In failure-free, high-contention scenarios, FLAC outperformed state-of-the-art protocols with a 2.22x throughput improvement and 2.82x latency reduction.
  • Adaptivity: The RL-tuned RLSM successfully navigated the trade-off between safety and speed, consistently outperforming versions with fixed parameters in unstable environments.
  • Scalability: FLAC maintained a performance lead of 1.20x to 1.62x even as the number of participants increased to 10.

Conclusion and Limitations

FLAC demonstrates that failure-awareness can significantly enhance the performance of atomic commit protocols. However, some limitations remain. The $O(N^2)$ message complexity in certain phases may impact very large transactions. Additionally, while the protocol is designed for non-replicated architectures, extensions for replicated systems are possible. Finally, while RLSM mitigates blocking risks, theoretical guarantees in purely asynchronous networks remain a challenge common to all ACPs.

Summary updated

BibTeX
@misc{pan2023flac,
  author = {Hexiang Pan and Quang-Trung Ta and Meihui Zhang and Yeow Meng Chee and Gang Chen and Beng Chin Ooi},
  title = {{FLAC: Practical Failure-Aware Atomic Commit Protocol for Distributed Transactions}},
  year = {2023},
  eprint = {2302.04500},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.04500},
}
Figure