Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

ISSUE-19628: PIP-251: Add snapshot stats in TransactionBufferStats #5561

Open
sijie opened this issue Feb 24, 2023 · 0 comments
Open

ISSUE-19628: PIP-251: Add snapshot stats in TransactionBufferStats #5561

sijie opened this issue Feb 24, 2023 · 0 comments

Comments

@sijie
Copy link
Member

sijie commented Feb 24, 2023

Original Issue: apache#19628


Motivation

As the multiple-snapshot introduced by PIP-196, 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:
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:
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.

@sijie sijie added the PIP label Feb 24, 2023
@sijie sijie changed the title ISSUE-19628: PIP-250: Add snapshot stats in TransactionBufferStats ISSUE-19628: PIP-251: Add snapshot stats in TransactionBufferStats Apr 1, 2023
@sijie sijie added the Stale label Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant