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

pdctl: support config balance-leader #4656

Merged
merged 39 commits into from
Mar 16, 2022
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ab6f582
speed up balance leader
CabinfeverB Feb 17, 2022
53e0973
balance leader config handler
CabinfeverB Feb 17, 2022
6342864
Merge branch 'speed_up_balance_leader' into balance_leader_conf
CabinfeverB Feb 17, 2022
f5be6dd
fix test
CabinfeverB Feb 17, 2022
263cc1c
fix scheduleController
CabinfeverB Feb 17, 2022
83c67aa
add handler
CabinfeverB Feb 17, 2022
26b44f7
add handler
CabinfeverB Feb 18, 2022
fb15d6a
support config balance leader
CabinfeverB Feb 18, 2022
0976e10
Merge branch 'master' into speed_up_balance_leader
CabinfeverB Mar 6, 2022
7798e88
change store uesd limit
CabinfeverB Mar 7, 2022
0528f86
refactor
CabinfeverB Mar 9, 2022
3f139b8
refactor controller
CabinfeverB Mar 9, 2022
065f012
refactor controller
CabinfeverB Mar 9, 2022
15925f9
refactor controller
CabinfeverB Mar 10, 2022
f55e76b
Merge remote-tracking branch 'upstream/master' into speed_up_balance_…
CabinfeverB Mar 10, 2022
6f9232b
simply
CabinfeverB Mar 10, 2022
2694e4c
Merge remote-tracking branch 'upstream/master' into balance_leader_conf
CabinfeverB Mar 10, 2022
a6a178b
change update method
CabinfeverB Mar 10, 2022
ebd48ed
merge
CabinfeverB Mar 10, 2022
795c69b
add test
CabinfeverB Mar 11, 2022
9672a21
add test
CabinfeverB Mar 11, 2022
751aa6d
Merge branch 'balance_leader_conf' into balance_leader_pdctl
CabinfeverB Mar 11, 2022
701a28a
add test
CabinfeverB Mar 11, 2022
2a93316
merge master
CabinfeverB Mar 14, 2022
db1a5c8
Merge branch 'balance_leader_conf' into balance_leader_pdctl
CabinfeverB Mar 14, 2022
50d4922
fix util
CabinfeverB Mar 14, 2022
ef8b984
fix util
CabinfeverB Mar 15, 2022
ccd2858
fix
CabinfeverB Mar 15, 2022
0245a45
fix
CabinfeverB Mar 15, 2022
b098573
fix config name
CabinfeverB Mar 16, 2022
ecef60b
add upper and lower bound
CabinfeverB Mar 16, 2022
0e5a34f
merge master
CabinfeverB Mar 16, 2022
6738352
merge master
CabinfeverB Mar 16, 2022
2f24cb6
fix test
CabinfeverB Mar 16, 2022
55cb08d
fix test
CabinfeverB Mar 16, 2022
2a0f3af
fix typo
CabinfeverB Mar 16, 2022
521e0b9
fix typo
CabinfeverB Mar 16, 2022
4c08c71
fix invalidate
CabinfeverB Mar 16, 2022
393b884
Merge branch 'master' into balance_leader_pdctl
ti-chi-bot Mar 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tools/pd-ctl/pdctl/command/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,31 @@ func NewConfigSchedulerCommand() *cobra.Command {
newConfigHotRegionCommand(),
newConfigShuffleRegionCommand(),
newConfigGrantHotRegionCommand(),
newConfigBalanceLeaderCommand(),
Copy link
Contributor

Choose a reason for hiding this comment

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

How about other scheduler.

Copy link
Member Author

Choose a reason for hiding this comment

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

How about other scheduler.

other schedulers should modify their config handler firstly

)
return c
}

func newConfigBalanceLeaderCommand() *cobra.Command {
Copy link
Contributor

Choose a reason for hiding this comment

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

The function is similar with newConfigHotRegionCommand, maybe exract same code.

Copy link
Member Author

@CabinfeverB CabinfeverB Feb 18, 2022

Choose a reason for hiding this comment

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

The function is similar with newConfigHotRegionCommand, maybe exract same code.

maybe I can abstract out a function for all schedulers

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, each scheduler has a different config API. It is possible to refactor it in the future, so I think just implement it simply now.

c := &cobra.Command{
Use: "balance-leader-scheduler",
Short: "balance-leader-scheduler config",
Run: listSchedulerConfigCommandFunc,
}

c.AddCommand(&cobra.Command{
Use: "show",
Short: "list the config item",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Short: "list the config item",
Short: "show the config item",

Run: listSchedulerConfigCommandFunc,
}, &cobra.Command{
Use: "set <key> <value>",
Short: "set the config item",
Run: func(cmd *cobra.Command, args []string) { postSchedulerConfigCommandFunc(cmd, c.Name(), args) },
})

return c
}

func newConfigHotRegionCommand() *cobra.Command {
c := &cobra.Command{
Use: "balance-hot-region-scheduler",
Expand Down