File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,9 @@ impl Client {
183
183
184
184
/// Request garbage collection (GC) of the TiKV cluster.
185
185
///
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.
187
189
///
188
190
/// For each key, the last mutation record (unless it's a deletion) before `safepoint` is retained.
189
191
///
Original file line number Diff line number Diff line change @@ -635,6 +635,11 @@ impl<PdC: PdClient> Transaction<PdC> {
635
635
res
636
636
}
637
637
638
+ /// Get the start timestamp of this transaction.
639
+ pub fn start_timestamp ( & self ) -> Timestamp {
640
+ self . timestamp . clone ( )
641
+ }
642
+
638
643
/// Send a heart beat message to keep the transaction alive on the server and update its TTL.
639
644
///
640
645
/// Returns the TTL set on the transaction's locks by TiKV.
You can’t perform that action at this time.
0 commit comments