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

gc_worker: resolve locks on offline stores #18383

Merged
merged 7 commits into from
Jul 14, 2020

Conversation

youjiali1995
Copy link
Contributor

Signed-off-by: youjiali1995 zlwgx1023@gmail.com

What problem does this PR solve?

Issue Number: close #18338
Problem Summary:
Green GC should scan locks on offline stores.

What is changed and how it works?

What's Changed:
Only skip tombstone stores.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit tes

Release note

  • Fix the issue that green GC doesn't scan locks on offline stores which may cause data incompleteness.

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
@youjiali1995 youjiali1995 added type/bugfix This PR fixes a bug. component/GC labels Jul 6, 2020
@youjiali1995 youjiali1995 added this to the v4.0.3 milestone Jul 6, 2020
@youjiali1995
Copy link
Contributor Author

BTW, I think we need cherry-pick it to release-3.0/3.1 too because offline stores are skipped during destroying ranges. It's possible an offline store becomes up if someone deletes a wrong store and reverts the operation. @MyonKeminta

@codecov
Copy link

codecov bot commented Jul 6, 2020

Codecov Report

Merging #18383 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #18383   +/-   ##
===========================================
  Coverage   79.4581%   79.4581%           
===========================================
  Files           541        541           
  Lines        146457     146457           
===========================================
  Hits         116372     116372           
  Misses        20787      20787           
  Partials       9298       9298           

@youjiali1995
Copy link
Contributor Author

@MyonKeminta PTAL

MyonKeminta
MyonKeminta previously approved these changes Jul 14, 2020
Copy link
Contributor

@MyonKeminta MyonKeminta left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -459,7 +459,7 @@ func (w *GCWorker) checkGCInterval(now time.Time) (bool, error) {
}

// validateGCLiftTime checks whether life time is small than min gc life time.
func (w *GCWorker) validateGCLiftTime(lifeTime time.Duration) (time.Duration, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 14, 2020
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jul 14, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 14, 2020
@cfzjywxk cfzjywxk added the status/can-merge Indicates a PR has been approved by a committer. label Jul 14, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@youjiali1995 merge failed.

@youjiali1995
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@youjiali1995 merge failed.

@youjiali1995
Copy link
Contributor Author

/run-integration-copr-test

@youjiali1995
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@youjiali1995 merge failed.

@youjiali1995
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 2024e44 into pingcap:master Jul 14, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 14, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #18550

@youjiali1995 youjiali1995 deleted the gc/scan-offline-store branch July 14, 2020 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/GC status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Green GC should scan offline stores
4 participants