Skip to content

Commit

Permalink
Export commitTS of KVTxn
Browse files Browse the repository at this point in the history
Signed-off-by: Bin Zhang <[email protected]>
  • Loading branch information
b6g committed Nov 11, 2024
1 parent c154447 commit be41b52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 0 additions & 5 deletions txnkv/transaction/test_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ func (txn TxnProbe) SetStartTS(ts uint64) {
txn.startTS = ts
}

// GetCommitTS returns the commit ts.
func (txn TxnProbe) GetCommitTS() uint64 {
return txn.commitTS
}

// GetUnionStore returns transaction's embedded unionstore.
func (txn TxnProbe) GetUnionStore() *unionstore.KVUnionStore {
return txn.us
Expand Down
7 changes: 7 additions & 0 deletions txnkv/transaction/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,13 @@ func (txn *KVTxn) StartTS() uint64 {
return txn.startTS
}

func (txn *KVTxn) CommitTS() uint64 {
if txn != nil {
return txn.commitTS
}
return 0
}

// Valid returns if the transaction is valid.
// A transaction become invalid after commit or rollback.
func (txn *KVTxn) Valid() bool {
Expand Down

0 comments on commit be41b52

Please sign in to comment.