dao-jun commented on code in PR #22024:
URL: https://github.com/apache/pulsar/pull/22024#discussion_r1493800841


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:
##########
@@ -287,8 +287,8 @@ private void handleTransactionMessage(TxnID txnId, Position 
position) {
                 .checkAbortedTransaction(txnId)) {
             ongoingTxns.put(txnId, (PositionImpl) position);
             PositionImpl firstPosition = 
ongoingTxns.get(ongoingTxns.firstKey());
-            //max read position is less than first ongoing transaction message 
position, so entryId -1
-            maxReadPosition = PositionImpl.get(firstPosition.getLedgerId(), 
firstPosition.getEntryId() - 1);
+            // max read position is less than first ongoing transaction 
message position
+            maxReadPosition = getPreviousPosition(firstPosition);

Review Comment:
   In fact, `entryId=-1` does not cause program exceptions, There are many uses 
of this in pulsar. 
   If modified here, it's not necessary but also acceptable



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