Skip to content

Commit

Permalink
Add background in pip298
Browse files Browse the repository at this point in the history
  • Loading branch information
hzh0425 committed Sep 10, 2023
1 parent 5395141 commit c357f6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pip/pip-298.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Motivation
## Background

In the implementation of the Pulsar Transaction, each topic is configured with a `Transaction Buffer` to prevent consumers from reading uncommitted messages, which are invisible until the transaction is committed. Transaction Buffer works with Position (maxReadPosition) and `TxnID` Set (aborts). The broker only dispatches messages, before the maxReadPosition, to the consumers. When the broker dispatches the messages before maxReadPosition to the consumer, the messages sent by aborted transactions will get filtered by the Transaction Buffer.

In the implementation of the Pulsar Transaction, each topic is configured with a `Transaction Buffer` to prevent consumers from reading uncommitted messages, which are invisible until the transaction is committed. Transaction Buffer works with Position (maxReadPosition) and `TxnID` Set (aborts).`maxReadPosition` is a position (`ledgerId` + entry sequence ID) for which it is guaranteed all messages up to it belong to a finished transaction (committed or aborted). Any messages related to an in-flight transaction are after maxReadPosition. The broker only dispatches messages, before the maxReadPosition, to the consumers. When the broker dispatches the messages before maxReadPosition to the consumer, the messages sent by aborted transactions will get filtered by the Transaction Buffer. It implements it by storing all the aborted transaction IDs in memory.
## Motivation

Currently, Pulsar transactions do not have configurable isolation levels. By introducing isolation level configuration for consumers, we can enhance the flexibility of Pulsar transactions.

Expand Down

0 comments on commit c357f6a

Please sign in to comment.