-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
gcworker: fix gc miss locks when region merged during scanning & resolving locks #22252
gcworker: fix gc miss locks when region merged during scanning & resolving locks #22252
Conversation
…lving locks Signed-off-by: lysu <[email protected]>
Signed-off-by: lysu <[email protected]>
store/tikv/gcworker/gc_worker.go
Outdated
if w.testingKnobs.resolveLocks != nil { | ||
ok, err1 = w.testingKnobs.resolveLocks(loc.Region) | ||
ok, err1 = w.testingKnobs.resolveLocks(locks, loc.Region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, err1 = w.testingKnobs.resolveLocks(locks, loc.Region) | |
ok, err1 = w.testingKnobs.resolveLocks(locks, locForResolve.Region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the log at line 1104 became not very meaningful 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's ok to simply change the loc
to locForResolve
too in that log
s.gcWorker.testingKnobs.scanLocks = func(key []byte, regionID uint64) []*tikv.Lock { | ||
if regionID == s.initRegion.regionID { | ||
return []*tikv.Lock{ | ||
{Key: []byte("a")}, | ||
{Key: []byte("b")}, | ||
{Key: []byte("o")}, | ||
{Key: []byte("p")}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can compare the key
parameter with these 4 locks, so that there should be 4 locks at line 942.
Signed-off-by: lysu <[email protected]>
Signed-off-by: lysu <[email protected]>
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-3.0 in PR #22266 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #22267 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.0-rc in PR #22268 |
…lving locks (#22252) (#22268) Signed-off-by: ti-srebot <[email protected]>
…lving locks (#22252) (#22267) Signed-off-by: ti-srebot <[email protected]> Signed-off-by: lysu <[email protected]>
…lving locks (#22252) (#22266) Signed-off-by: ti-srebot <[email protected]> Signed-off-by: lysu <[email protected]>
Signed-off-by: lysu [email protected]
What problem does this PR solve?
Issue Number: close #22245
Problem Summary:
just as
TestResolveLockRangeMeetRegionEnlargeCausedByRegionMerge
What is changed and how it works?
What's Changed, How it Works:
we need re-scan region's lock when found merged region's EndKey 's larger than origional region's EndKey
Related changes
Check List
Tests
Side effects
Release note
This change is