liangyepianzhou opened a new issue, #19628:
URL: https://github.com/apache/pulsar/issues/19628

   ### Motivation
   
   As the multiple-snapshot introduced by 
[PIP-196](https://github.com/apache/pulsar/issues/16913), the mechanism of 
Transaction Buffer Snapshot becomes more complex. We need more information to 
sense the status of the Transaction Buffer Snapshot.
   Because the Transaction Buffer Snapshot is part of the Transaction Buffer, 
we plan to add an internal class in `TransactionBufferStats` to record the 
stats of the transaction snapshot.
   
   ### Goal
   
   Add an internal class in  `TransactionBufferStats`  to record the stats of 
the transaction snapshot. Let users can use the admin tool to get enough 
information about the transaction buffer snapshot.
   
   ### API Changes
   
   This PIP will change the result of  
`admin.transactions().getTransactionBufferStats(yourTopicName);`.
   
   
   
   ### Implementation
   
   * The previous results are as follows:
   ```java
   public class TransactionBufferStats {
   
      /** The state of this transaction buffer. */
      public String state;
   
      /** The max read position of this transaction buffer. */
      public String maxReadPosition;
   
      /** The last snapshot timestamps of this transaction buffer. */
      public long lastSnapshotTimestamps;
   }
   ```
   * The expected results are as follows:
   ```java
   public class TransactionBufferStats {
     /** The state of this transaction buffer. */
      public String state;
   
      /** The max read position of this transaction buffer. */
      public String maxReadPosition;
   
      /** The last snapshot timestamps of this transaction buffer.*/
      public long lastSnapshotTimestamps;
      /** The stats of snapshots that only exist when enabling multiple 
snapshot segments. */
      public SnapshotStats snapshotStats;
          
      public static class SnapshotStats {
           public long segmentsSize;
   
           public long unsealedAbortTxnIDs;
      }
   }
   ```
   
   ### Alternatives
   
   _No response_
   
   ### Anything else?
   
   ## Compatibility
   This modification will not break the previous usage of the admin tool. 
   In the previous usages, the `snapshotStats` will be ignored and other member 
variables have not changed.
   In the new implementations, the users who enable the transaction buffer 
snapshot segment can get the snapshot segment stats from 
`TransactionBufferStats.snapshotStats`.
   


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