tikv / tikv/pd

Coordinator can't stop in time, because of background jobs are still running

Open
#5,274 6 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Bug Report
I have posted a post on the forum, see https://asktug.com/t/topic/694191/3 .
In short, the problem is that when coordinator is stopping the scheduler will still keep running until all jobs are finished.

The following figure shows that it takes a long time for the coordinator to close from the beginning to the end, in this case more than 10 minutes.
image

I think the root cause is that schedulers and other background jobs have no way to receive the signal to exit when coordinator is stopping.

### What did you do?
pd leader lease timeout.
image

### What did you expect to see?
Follower campaign for leader in time.

### What did you see instead?
Follower can't campaign for leader in 10 minutes, and keep print the following log.
image

### What version of PD are you using (`pd-server -V`)?
5.3.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.