thetumbled commented on code in PR #22610:
URL: https://github.com/apache/pulsar/pull/22610#discussion_r1582730866


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -3647,7 +3647,14 @@ public CompletableFuture<Position> 
getLastDispatchablePosition() {
             return 
ManagedLedgerImplUtils.asyncGetLastValidPosition((ManagedLedgerImpl) ledger, 
entry -> {
                 MessageMetadata md = 
Commands.parseMessageMetadata(entry.getDataBuffer());
                 // If a messages has marker will filter by 
AbstractBaseDispatcher.filterEntriesForConsumer
-                return !Markers.isServerOnlyMarker(md);
+                if (Markers.isServerOnlyMarker(md)) {
+                    return false;
+                } else if (md.hasTxnidMostBits() && md.hasTxnidLeastBits()) {
+                    // Filter-out transaction aborted messages.
+                    TxnID txnID = new TxnID(md.getTxnidMostBits(), 
md.getTxnidLeastBits());
+                    return !isTxnAborted(txnID, (PositionImpl) 
entry.getPosition());

Review Comment:
   Same in https://github.com/apache/pulsar/pull/21951.



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to