This is an automated email from the ASF dual-hosted git repository.
xiangying pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 434da8b5cc7 [cleanup] [broker] fix doc for
TransactionBuffer#isTxnAborted (#21956)
434da8b5cc7 is described below
commit 434da8b5cc76a08215319be7ab066e1d1c23f6c4
Author: thetumbled <[email protected]>
AuthorDate: Thu Jan 25 17:45:31 2024 +0800
[cleanup] [broker] fix doc for TransactionBuffer#isTxnAborted (#21956)
### Motivation
~~The argument `PositionImpl readPosition` of method
`org.apache.pulsar.broker.transaction.buffer.TransactionBuffer#isTxnAborted` is
weird and unneccessary, we have better remove it to avoid confusion.~~
Argument `PositionImpl readPosition` is used for future.
### Modifications
~~Remove the argument `PositionImpl readPosition`.~~
fix the doc and add to-do to avoid confusion.
---
.../apache/pulsar/broker/transaction/buffer/TransactionBuffer.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/TransactionBuffer.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/TransactionBuffer.java
index 7eb5d6f789c..ae0b9bbf1ca 100644
---
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/TransactionBuffer.java
+++
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/TransactionBuffer.java
@@ -139,10 +139,12 @@ public interface TransactionBuffer {
CompletableFuture<Void> closeAsync();
/**
- * Close the buffer asynchronously.
+ * Check if the txn is aborted.
+ * TODO: To avoid broker oom, we will load the aborted txn from snapshot
on demand.
+ * So we need the readPosition to check if the txn is loaded.
* @param txnID {@link TxnID} txnId.
* @param readPosition the persistent position of the txn message.
- * @return the txnId is aborted.
+ * @return whether the txn is aborted.
*/
boolean isTxnAborted(TxnID txnID, PositionImpl readPosition);