codelipenghui commented on code in PR #15424:
URL: https://github.com/apache/pulsar/pull/15424#discussion_r868065508


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:
##########
@@ -240,6 +244,13 @@ public CompletableFuture<Void> 
checkIfTBRecoverCompletely(boolean isTxnEnabled)
     @Override
     public CompletableFuture<Position> appendBufferToTxn(TxnID txnId, long 
sequenceId, ByteBuf buffer) {
         CompletableFuture<Position> completableFuture = new 
CompletableFuture<>();
+        Long lowWaterMark = lowWaterMarks.get(txnId.getMostSigBits());
+        if (lowWaterMark != null && lowWaterMark >= txnId.getLeastSigBits()) {
+            completableFuture.completeExceptionally(new 
TransactionBufferException
+                    .TransactionNotFoundException("Transaction [" + txnId + "] 
has been ended. "
+                    + "Please use a new transaction to send message."));
+            return completableFuture;

Review Comment:
   But the `NotAllowedException` will also be wrapped by 
`ManagedLedgerException` ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to