tikv / tikv/pd

Load rules should not block leader election

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

Description

## Enhancement Task
Before a PD becomes the leader, it will do some initialization work, see

https://github.com/tikv/pd/blob/9fe5653625628f54f7fe971b470a9969e63d8633/pkg/schedule/labeler/labeler.go#L54

https://github.com/tikv/pd/blob/9fe5653625628f54f7fe971b470a9969e63d8633/pkg/schedule/placement/rule_manager.go#L101-L106

If one of them has too many rules, the election will be blocked. It can significantly increase the unavailable time. One possible solution is moving these kinds of jobs to the coordinator. We can also guarantee that they are loaded before the scheduling job starts.

Contributor guide

Open the contributing guide

Research direction

Start with pkg/schedule/labeler/labeler.go at the linked initialization code and pkg/schedule/placement/rule_manager.go around lines 101-106, then trace how these jobs interact with PD leader election and scheduling startup. Done means excessive rule loading no longer blocks election, while rules are guaranteed to be loaded before scheduling begins; the issue does not identify a test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.