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

safepoint: support to set safepoints for services #2348

Merged
merged 19 commits into from
Apr 21, 2020

Conversation

shafreeck
Copy link
Contributor

@shafreeck shafreeck commented Apr 13, 2020

Signed-off-by: Shafreeck Sea [email protected]

What problem does this PR solve?

When a TiKV cluster has multiple components rely on the GC safe point, they should have agreement of value of safe point which determines what data would be deleted.

For example, TiCDC captures the data change event after the safe point, if the safe point advances too quickly, TiCDC can not handle the case.

This PR relies on pingcap/kvproto#603

What is changed and how it works?

  • Add UpdateServiceGCSafePoint to update the safe point for service and return the minimum value across all the services

Release note

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Code changes

  • Has persistent data change

@shafreeck shafreeck self-assigned this Apr 13, 2020
server/core/storage.go Outdated Show resolved Hide resolved
server/core/storage.go Outdated Show resolved Hide resolved
server/grpc_service.go Outdated Show resolved Hide resolved
server/core/storage.go Outdated Show resolved Hide resolved
server/server.go Outdated Show resolved Hide resolved
server/core/storage.go Outdated Show resolved Hide resolved
Signed-off-by: Shafreeck Sea <[email protected]>
Signed-off-by: Shafreeck Sea <[email protected]>
Signed-off-by: Shafreeck Sea <[email protected]>
@shafreeck
Copy link
Contributor Author

@disksing @nolouch The feature is reimplemented and please review it again.

The original API and data are left unchanged. A new API called UpdateServiceGCSafePoint is added to coordinate the GC safe point value, it updates the safe point for service and returns the minimum value in the cluster. For TiDB, it can call UpdateGCSafePoint with the minimum value to trigger the distributed GC job or do the job locally.

@shafreeck shafreeck added component/api HTTP API. type/enhancement The issue or PR belongs to an enhancement. and removed status/DNM labels Apr 17, 2020
Signed-off-by: Shafreeck Sea <[email protected]>
@shafreeck
Copy link
Contributor Author

@nolouch @rleungx PTAL

Signed-off-by: Shafreeck Sea <[email protected]>
@shafreeck shafreeck added the status/can-merge Indicates a PR has been approved by a committer. label Apr 21, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Apr 21, 2020

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/api HTTP API. status/can-merge Indicates a PR has been approved by a committer. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants