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

server/cluster: automatic gc tombstone store #5726

Merged
merged 3 commits into from
Nov 25, 2022

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Nov 23, 2022

Signed-off-by: nolouch nolouch@gmail.com

What problem does this PR solve?

Issue Number: Close #5348

What is changed and how does it work?

In a long-running cluster, there are too many tombstones. introduce auto gc mechanism.

server/cluster: automatic gc tombstone store

Check List

Tests

  • Unit test
cluster: automatic gc tombstone store

Signed-off-by: nolouch <nolouch@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 23, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024
  • rleungx

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.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 23, 2022
@nolouch nolouch requested review from HunDunDM and removed request for disksing November 23, 2022 10:47
@nolouch
Copy link
Contributor Author

nolouch commented Nov 23, 2022

ptal @rleungx @HunDunDM

@nolouch nolouch changed the title cluster: automatic gc tombstone store server/cluster: automatic gc tombstone store Nov 23, 2022
@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Base: 75.50% // Head: 75.82% // Increases project coverage by +0.32% 🎉

Coverage data is based on head (f95b7aa) compared to base (3606b68).
Patch coverage: 40.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5726      +/-   ##
==========================================
+ Coverage   75.50%   75.82%   +0.32%     
==========================================
  Files         329      329              
  Lines       32768    32777       +9     
==========================================
+ Hits        24741    24854     +113     
+ Misses       5871     5799      -72     
+ Partials     2156     2124      -32     
Flag Coverage Δ
unittests 75.82% <40.00%> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/cluster/cluster.go 82.17% <40.00%> (+0.48%) ⬆️
pkg/metricutil/metricutil.go 82.75% <0.00%> (-10.35%) ⬇️
server/encryptionkm/key_manager.go 70.11% <0.00%> (-1.60%) ⬇️
server/schedulers/hot_region_v2.go 88.30% <0.00%> (-1.17%) ⬇️
server/election/leadership.go 77.31% <0.00%> (-1.04%) ⬇️
server/tso/tso.go 67.97% <0.00%> (-0.57%) ⬇️
server/schedule/operator_controller.go 86.26% <0.00%> (-0.23%) ⬇️
pkg/tempurl/tempurl.go 60.00% <0.00%> (ø)
server/grpc_service.go 49.95% <0.00%> (+0.32%) ⬆️
server/cluster/unsafe_recovery_controller.go 79.31% <0.00%> (+0.34%) ⬆️
... and 26 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -1523,6 +1524,20 @@ func (c *RaftCluster) checkStores() {
for _, store := range stores {
// the store has already been tombstone
if store.IsRemoved() {
if store.DownTime() > gcTombstoreInterval {
// TODO: remove this lock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lock can be ignore , the delete store locked has two step: 1. delete meta from etcd by txn and delete store from store map(have store lock).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the function name warns me to use the lock.

Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use lock? the rest LGTM

Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except for the comment.

@nolouch
Copy link
Contributor Author

nolouch commented Nov 25, 2022

PTAL @bufferflies @rleungx

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 25, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 25, 2022
@nolouch
Copy link
Contributor Author

nolouch commented Nov 25, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: f95b7aa

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 25, 2022
@ti-chi-bot ti-chi-bot merged commit 441f0fb into tikv:master Nov 25, 2022
@nolouch nolouch deleted the clear_tombstone branch November 25, 2022 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto gc the tombstone store
5 participants