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

Compatible issues between async commit and green GC #82

Open
youjiali1995 opened this issue Dec 9, 2020 · 5 comments
Open

Compatible issues between async commit and green GC #82

youjiali1995 opened this issue Dec 9, 2020 · 5 comments

Comments

@youjiali1995
Copy link
Contributor

  1. Green GC is not compatible with async commit if async apply is enabled: A lock isn't applied and the transaction may be committed.
  2. TBD
@sticnarf
Copy link
Contributor

sticnarf commented Dec 9, 2020

It's a blocker for enabling async apply by default. Maybe not a blocker for async commit GA.

@MyonKeminta
Copy link
Contributor

For ScanLock and PhysicalScanLock requests, it should update the max_ts, check the memory lock, and finally read the raftkv or the rocksdb.
For checking memory locks, there are two possible implementations: wait for the memory lock being released, or return them to the client. But for the second way, the implementation should carefully keep the increasing order of the keys in the response, and do not return the found memory locks that are greater than max lock from rocksdb (to avoid missing range since tidb will continue scanning from the last key in the response).

@MyonKeminta
Copy link
Contributor

As for async apply prewrite, can we let TiKV simply return error for green gc requests if async apply prewrite is enabled?

@youjiali1995
Copy link
Contributor Author

There is another corner case that green GC doesn't solve now.. tikv/tikv#8184 (comment)

@MyonKeminta
Copy link
Contributor

Ah.. yes.. and

As for async apply prewrite, can we let TiKV simply return error for green gc requests if async apply prewrite is enabled?

I notice that this is not a good idea considering the case that TiKV's config is changed and restarted.

Recently Jay discussed with me about a new idea that maybe we can use resolved_ts to determine if there's any lock before safepoint that needs to be resolved. Since resolved_ts will also be used by follower stale read, it may be an always-running service, instead of running only if needed by CDC. I think this is a possible substitution to green gc, but sounds hard to deliver it in 5.0 GA.

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

No branches or pull requests

3 participants