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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -3942,9 +3942,13 @@ public void publishTxnMessage(TxnID txnID, ByteBuf 
headersAndPayload, PublishCon
     @Override
     public CompletableFuture<Void> endTxn(TxnID txnID, int txnAction, long 
lowWaterMark) {
         if (TxnAction.COMMIT_VALUE == txnAction) {
-            return transactionBuffer.commitTxn(txnID, lowWaterMark);
+            return transactionBuffer.commitTxn(txnID, lowWaterMark).thenRun(() 
-> {
+                lastDataMessagePublishedTimestamp = Clock.systemUTC().millis();

Review Comment:
   `lastDataMessagePublishedTimestamp` is used to determined whether there are 
new messages available for reading by `ReplicatedSubscription` feature 
**only**. So we should update it when the max read position move forward.
   It is normal that we produce transactional messages only for a specific 
topic, in such case we don't update `LastDataMessagePublishedTimestamp` at all 
for now, we need to fix it.
   



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