You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/21 12:26:21 UTC

[GitHub] [pulsar] eolivelli commented on a diff in pull request #15675: [Improve][txn] extend admin tools for transaction component.

eolivelli commented on code in PR #15675:
URL: https://github.com/apache/pulsar/pull/15675#discussion_r902553526


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:
##########
@@ -881,9 +881,17 @@ public CompletableFuture<PendingAckHandle> pendingAckHandleFuture() {
     }
 
     @Override
-    public TransactionPendingAckStats getStats() {
+    public TransactionPendingAckStats getStats(boolean lowWaterMarks) {
         TransactionPendingAckStats transactionPendingAckStats = new TransactionPendingAckStats();
         transactionPendingAckStats.state = this.getState().name();
+        if (lowWaterMarks) {
+            transactionPendingAckStats.lowWaterMarks = this.lowWaterMarks;
+        }
+        if (individualAckOfTransaction != null) {
+            transactionPendingAckStats.ongoingTxnSize = individualAckOfTransaction.size();

Review Comment:
   I am not sure about the synchronisation around "individualAckOfTransaction"
   I suggest to declare a temporary variable and do not access twice the instance field
   
    



-- 
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-unsubscribe@pulsar.apache.org

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