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


##########
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:
   I have change exception from `TransactionNotFoundException` to 
`NotAllowedException`.
   And the `NotAllowedException` is not only used to `Exceed maximum message 
size`, so i change  the `recoverNotAllowedError` to make the expression of the 
log clearer.



-- 
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