-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
store: fix potential panic in GC worker #14403
Conversation
/run-all-tests |
store/tikv/gcworker/gc_worker.go
Outdated
@@ -1067,42 +1067,39 @@ func (w *GCWorker) doGC(ctx context.Context, safePoint uint64, concurrency int) | |||
|
|||
func (w *GCWorker) checkLeader() (bool, error) { | |||
metrics.GCWorkerCounter.WithLabelValues("check_leader").Inc() | |||
se := createSession(w.store) | |||
defer se.Close() |
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.
/run-all-tests |
Signed-off-by: Shuaipeng Yu <[email protected]>
Signed-off-by: Shuaipeng Yu <[email protected]>
ea1735c
to
29b1e92
Compare
/run-all-tests |
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.
Rest LGTM
store/tikv/gcworker/gc_worker.go
Outdated
se := createSession(w.store) | ||
defer se.Close() |
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.
It seems the session is not used in this function
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.
addressed
Signed-off-by: Shuaipeng Yu <[email protected]>
LGTM |
/merge |
/run-all-tests |
@jackysp merge failed. |
/merge |
/run-all-tests |
cherry pick to release-3.0 failed |
Conflicts: store/tikv/gcworker/gc_worker.go store/tikv/gcworker/gc_worker_test.go
Hi @jackysp , please update the release note in the PR description, thanks! |
Signed-off-by: Shuaipeng Yu [email protected]
What problem does this PR solve?
Try to fix
What is changed and how it works?
Do not create a private session for
checkLeader
.Check List
Tests
Code changes
Related changes