client-rust icon indicating copy to clipboard operation
client-rust copied to clipboard

Support GC

Open ekexium opened this issue 5 years ago • 10 comments

TiKV uses MVCC to support transactions, thus GC is needed to remove stale data. Current implementation of rust-client does not provide GC functionalities.

A workaround is using the script which calls TiDB's GC functions to manually trigger GC.

An initial implementation of GC #182 .

If we let users manage GC, we should provide a guide.

ekexium avatar Sep 30 '20 07:09 ekexium

I noticed that the gc function does not use the gc request, which is a bit confusing. AIUI, we currently gc locks but not deleted data (the delete ranges step) or old data (which uses the gc request).

nrc avatar Dec 08 '20 19:12 nrc

I noticed that the gc function does not use the gc request, which is a bit confusing. AIUI, we currently gc locks but not deleted data (the delete ranges step) or old data (which uses the gc request).

The new GC mechanism(https://docs.pingcap.com/tidb/stable/garbage-collection-overview#do-gc) only requires updating safepoint on PD. "TiKV automatically detects the change of safe point and performs GC for all Region leaders on the current node."

ekexium avatar Dec 09 '20 02:12 ekexium

The link is broken for me. Does that mean we don't need to support the gc message at all?

nrc avatar Dec 10 '20 02:12 nrc

Yes, I think. The link is updated.

ekexium avatar Dec 10 '20 02:12 ekexium

@ekexium is it ok to close this issue now? We have a gc function, which I think does what it should.

nrc avatar Jan 19 '21 22:01 nrc

GC support is not in perfect state, so I prefer to keep it open.

The gc function is not well tested yet. And I think there are open questions. For example, should we provide automatic GC?

ekexium avatar Jan 20 '21 02:01 ekexium

I've written up an RFC for future work on GC refractory. Once this is implemented, the client may need to support editing GC barrier via PD.

andylokandy avatar May 06 '21 07:05 andylokandy

What's the status of the GC feature ?

frostyplanet avatar Dec 11 '21 16:12 frostyplanet

It's still the same.

andylokandy avatar Dec 13 '21 05:12 andylokandy

May I ask the difference of current implementation from the one in tikv/client-go code ?

frostyplanet avatar Dec 16 '21 15:12 frostyplanet