How transactions work?
This section describes transaction components and how the components work together. For the complete design details, see PIP-31: Transactional Streaming.
Key concept
It is important to know the following key concepts, which is a prerequisite for understanding how transactions work.
Transaction coordinator
The transaction coordinator (TC) is a module running inside a Pulsar broker.
-
It maintains the entire life cycle of transactions and prevents a transaction from getting into an incorrect status.
-
It handles transaction timeout, and ensures that the transaction is aborted after a transaction timeout.
Transaction log
All the transaction metadata persists in the transaction log. The transaction log is backed by a Pulsar topic. If the transaction coordinator crashes, it can restore the transaction metadata from the transaction log.
The transaction log stores the transaction status rather than actual messages in the transaction (the actual messages are stored in the actual topic partitions).