DEV Community

Georgii
Georgii

Posted on

Commit to marriage with TLA+ pt.2

Introduction

This is the second blog post (here is the first one [1]) in the series of the conspectus of the "Introduction to TLA+" course by Leslie Lamport. As usual, all credits are to Leslie Lamport and his course that can be found on his website. In this part, we will consider the Transaction Commit and Two-Phase Commit algorithms.

Transaction Commit

In the first part we consider the Transaction Commit algorithm [3], pp.2-4. In a distributed system, a transaction commit involves multiple resource managers (RMs) across different nodes that must unanimously decide to either commit or abort a transaction. The protocol ensures that all RMs either reach a committed state or an aborted state, supported by the conditions of stability and consistency, which mandate that once an RM reaches one of these states, it cannot revert, and no RM can be in the opposite state.

A database transaction is performed by a collection of processes called resource managers. A transaction can either commit or abort. It can commit only iif all resource managers are prepared to commit and must abort if any resource manager wants to abort.

All resource managers must agree on whether a transaction is committed or aborted.

Unfortunately, this platform does not fully support the formatting we have on our website, so if you are interested, please read the original blog post.

Top comments (0)