liangyepianzhou commented on code in PR #19631:
URL: https://github.com/apache/pulsar/pull/19631#discussion_r1227929917
##########
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 believe the most crucial consideration is whether we need to provide full
concurrency safety guarantees for this admin API. If it is necessary to ensure
that the data obtained by the admin is not affected by concurrent operations,
then we must introduce locks for the `generateSnapshotStats` and
`putAbortedTxnAndPosition` methods. We also need to consider whether we should
introduce locks for the hot path of message sending in this admin API.
--
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]