Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIP-251: Add snapshot stats in TransactionBufferStats #19628

Closed
liangyepianzhou opened this issue Feb 24, 2023 · 3 comments
Closed

PIP-251: Add snapshot stats in TransactionBufferStats #19628

liangyepianzhou opened this issue Feb 24, 2023 · 3 comments
Assignees

Comments

@liangyepianzhou
Copy link
Contributor

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.

@michaeljmarshall michaeljmarshall changed the title PIP-250: Add snapshot stats in TransactionBufferStats PIP-251: Add snapshot stats in TransactionBufferStats Feb 27, 2023
@michaeljmarshall
Copy link
Member

@liangyepianzhou - I updated the PIP number since I already submitted PIP 250 just a few hours earlier.

@congbobo184
Copy link
Contributor

   /** 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;
   }

I suggest change snapshotStats to MultiSnapshotStats. it will include one snapshot segment detail and index detail.

detail include, time, abortTxns, snapshot postion eg.

@github-actions
Copy link

github-actions bot commented Apr 1, 2023

The issue had no activity for 30 days, mark with Stale label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants