File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,9 @@ impl Client {
183183
184184 /// Request garbage collection (GC) of the TiKV cluster.
185185 ///
186- /// GC deletes MVCC records whose timestamp is lower than the given `safepoint`.
186+ /// GC deletes MVCC records whose timestamp is lower than the given `safepoint`. We must guarantee
187+ /// that all transactions started before this timestamp had committed. We can keep an active
188+ /// transaction list in application to decide which is the minimal start timestamp of them.
187189 ///
188190 /// For each key, the last mutation record (unless it's a deletion) before `safepoint` is retained.
189191 ///
Original file line number Diff line number Diff line change @@ -635,6 +635,11 @@ impl<PdC: PdClient> Transaction<PdC> {
635635 res
636636 }
637637
638+ /// Get the start timestamp of this transaction.
639+ pub fn start_timestamp ( & self ) -> Timestamp {
640+ self . timestamp . clone ( )
641+ }
642+
638643 /// Send a heart beat message to keep the transaction alive on the server and update its TTL.
639644 ///
640645 /// Returns the TTL set on the transaction's locks by TiKV.
You can’t perform that action at this time.
0 commit comments