Closed ti-chi-bot closed 1 year ago
[REVIEW NOTIFICATION]
This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer
in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer
in the comment to help you merge this pull request.
The full list of commands accepted by this bot can be found here.
/run-all-tests
/run-all-tests
/merge
This pull request has been accepted and is ready to merge.
This is an automated cherry-pick of #2634
What problem does this PR solve?
TiSpark does not have a mechanism to check GC. So, you may get the wrong data if your transaction's start_ts behind safe_point
What is changed and how it works?
This PR introduced the service safe point in TiSpark. TiKV will use the min service safe point among all service (including TiDB).
TiSpark will generate a new serviceId for every spark session. Every spark session will register the min start_ts as its' service safe point to PD. Thus, the safe point will not exceed the min start_ts among all spark applications.
Test
It is hard to write IT. Here are the results I test locally.
TiKV metric shows TiSpark service safe point can pause the safe point.
TiKV metric shows safe point will recovery after the TiSpark finished: The GC safe point turns from 17:02:55 to 17:18:39. which means TiSpark will not block it anymore.