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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/SnapshotSegmentAbortedTxnProcessorImpl.java:
##########
@@ -384,8 +385,12 @@ public CompletableFuture<Void> clearAbortedTxnSnapshot() {
     }
 
     @Override
-    public long getLastSnapshotTimestamps() {
-        return this.lastSnapshotTimestamps;
+    public void getSnapshotStats(TransactionBufferStats stats) {
+        stats.lastSnapshotTimestamps = this.lastSnapshotTimestamps;
+        TransactionBufferStats.SnapshotStats snapshotStats = new 
TransactionBufferStats.SnapshotStats();
+        snapshotStats.segmentsSize = this.indexes.size();
+        snapshotStats.unsealedAbortTxnIDs = this.unsealedTxnIds.size();
+        stats.snapshotStats = snapshotStats;

Review Comment:
   I can replace ` snapshotStats.segmentsSize = this.indexes.size();` with 
`snapshotStats.unsealedAbortTxnIDs = this.unsealedTxnIds.size();` which update 
before persistenting segment, but the concurrent problem still exists.



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