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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:
##########
@@ -321,6 +323,8 @@ public void addComplete(Position position, ByteBuf 
entryData, Object ctx) {
                         }
                         txnCommittedCounter.increment();
                         completableFuture.complete(null);
+                        // need to update the last data message published 
timestamp
+                        
topic.setLastDataMessagePublishedTimestamp(Clock.systemUTC().millis());

Review Comment:
   I've checked the source code, it is for `ReplicatedSubscriptionsController`, 
use `LastDataMessagePublishedTimestamp` to determine if we need to snapshot. In 
an ideal situation, we need to update `LastDataMessagePublishedTimestamp` after 
txn committed. But topic transaction buffer just maintain the first message 
position of the txn. Maybe we can update `LastDataMessagePublishedTimestamp` 
after txn committed.



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