Commit Graph

66 Commits

Author SHA1 Message Date
tongjian 6df10cf4d5
util: move keyrange to keyutils (#9321)
close tikv/pd#9323

Signed-off-by: 童剑 <1045931706@qq.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-05-15 06:06:08 +00:00
Ryan Leung e907aac6fc
*: enable gci (#8925)
ref tikv/pd#4322

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-12-17 07:23:16 +00:00
okJiang 90cc61b432
scheduler: add test for creating evict-leader-scheduler twice (#8757)
close tikv/pd#8756

Signed-off-by: okJiang <819421878@qq.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-11-21 08:33:35 +00:00
lhy1024 8bc974941e
scheduler: replace pauseLeader with two flags and add source filter to transferIn (#8623)
close tikv/pd#8621

Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-11-11 07:10:37 +00:00
Ryan Leung 25dedabf52
*: reduce rand NewSource (#8675)
close tikv/pd#8674

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-09-29 09:41:39 +00:00
Ryan Leung 6b927e1179
*: reset config if the input is invalid (#8632)
close tikv/pd#8619

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-09-24 05:52:27 +00:00
okJiang 23d544f374
scheduler: add disable to independent config (#8567)
ref tikv/pd#8474

Signed-off-by: okJiang <819421878@qq.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-09-18 11:22:23 +00:00
okJiang ce1d0e800f
scheduler: remove old scheduler name (#8516)
ref tikv/pd#8379

Signed-off-by: okJiang <819421878@qq.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-08-21 05:24:11 +00:00
okJiang 8644ec6e75
*: instead scheduler type string of types.CheckerSchedulerType (#8485)
ref tikv/pd#8379

- Remove the old scheduler type, such as BalanceLeaderType
- Instead old scheduler type string of types.CheckerSchedulerType
- Instead old scheduler name of types.CheckerSchedulerType in SchedulerRegisterMap

Signed-off-by: okJiang <819421878@qq.com>
2024-08-08 11:47:10 +00:00
okJiang 1335ff93a4
*: add some comments to exported function, part 2 of enable revive.exported (#8481)
ref tikv/pd#8458

Signed-off-by: okJiang <819421878@qq.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-08-05 04:42:39 +00:00
okJiang 87ec78819d
scheduler: GetType() returns types.CheckerSchedulerType directly (#8440)
ref tikv/pd#8379

- GetType() returns types.CheckerSchedulerType directly
- keep the compatibility in `PersistOptions` and `PersistConfig“
- wrap `operator.OperatorLimitCounter.WithLabelValues().Inc()` to func `IncOperatorLimitCounter`

Signed-off-by: okJiang <819421878@qq.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-08-01 13:01:20 +00:00
okJiang 84f90f464a
*: add some comments to exported function, part of enable revive.exported (#8459)
ref tikv/pd#8458

Signed-off-by: okJiang <819421878@qq.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-07-31 06:43:18 +00:00
okJiang e7c9d1514b
*: set errcheck exclude func (#8346)
close tikv/pd#1919

Signed-off-by: okJiang <819421878@qq.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-06-28 09:53:55 +00:00
okJiang cb28ca8ed2
*: enable error check for some files (#8301)
ref tikv/pd#1919

Signed-off-by: okJiang <819421878@qq.com>
2024-06-19 05:31:17 +00:00
Ryan Leung 7e18a69734
*: improve the linter and fix some bugs (#8015)
close tikv/pd#8019

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-04-11 09:00:22 +00:00
Yongbo Jiang cd0ffbafaa
*: replace interface{} with any (#7774)
ref tikv/pd#4399

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
2024-01-31 15:21:25 +00:00
lhy1024 5a4e9efd84
mcs: fix scheduler memory sync in api server (#7389)
close tikv/pd#7388

Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-11-20 09:46:10 +00:00
JmPotato e295e628f4
scheduling: sync schedulers from the API server (#7076)
ref tikv/pd#5839

- Sync the schedulers from the API server.
- Dynamically reload the scheduler config.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
2023-09-14 07:00:11 +00:00
Ryan Leung 727d027452
*: decouple the scheduler and checker interfaces (#6776)
ref tikv/pd#5839

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-07-14 09:51:44 +00:00
Ryan Leung 181e6137e6
pkg: use minimum interface for schedulers (#6553)
ref tikv/pd#5839, ref tikv/pd#6551

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2023-06-09 07:32:47 +00:00
Ryan Leung 09dcabed7b
*: remove unnecessary interfaces (#6551)
ref tikv/pd#5839

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-06-06 08:39:41 +00:00
Ryan Leung f7a4c6305e
*: put the scheduler related logic together (#6491)
ref tikv/pd#5839, ref tikv/pd#6418, ref tikv/pd#6490

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-05-23 05:05:37 +00:00
Ryan Leung a14f38f3f8
*: put the operator related logic together (#6490)
ref tikv/pd#5839, ref tikv/pd#6418, ref tikv/pd#6489

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2023-05-23 02:45:38 +00:00
Ryan Leung 4725351884
*: introduce the cluster informer for decoupling the dependencies (#6489)
ref tikv/pd#5839, ref tikv/pd#6418

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-05-22 09:39:38 +00:00
buffer 21a333c435
filter: add new filter for send snapshot (#6146)
close tikv/pd#6145

1. create new filter to pick the store who's snapshot sender is available.
2. store limit level is same with the operator level , the level is defined in this [pr](https://github.com/tikv/pd/pull/5575)

Signed-off-by: bufferflies <1045931706@qq.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2023-03-30 18:30:55 +08:00
混沌DM 6f6f545a67
*: move `statistics`, `schedule` from `server` to `pkg` (#6133)
ref tikv/pd#5839

Signed-off-by: HunDunDM <hundundm@gmail.com>
2023-03-10 16:19:13 +08:00
buffer c40e319f50
remove priority from limit (#6089)
ref tikv/pd#5467

unify the priority level.

Signed-off-by: bufferflies <1045931706@qq.com>
2023-03-03 18:49:11 +08:00
Ryan Leung 05228ba0fe
*: decouple the dependency between config and schedule (#5792)
ref tikv/pd#5838

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: 混沌DM <hundundm@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2023-03-03 13:47:10 +08:00
Ryan Leung 40b6daffec
*: move core to pkg (#5781)
* move core to pkg

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* resolve the conflicts

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2023-01-12 17:39:52 +08:00
Ryan Leung 84c0f825ac
*: move id and version to pkg (#5780)
ref tikv/pd#5766

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2022-12-14 16:56:52 +08:00
ShuNing 8227cdba21
*: move all util relative package to utils (#5764)
ref tikv/pd#5766

*: move all util relative package to utils

Signed-off-by: nolouch <nolouch@gmail.com>
2022-12-08 17:26:05 +08:00
buffer 8e2bd59fc6
schedule: batch to report the metrics of target filter (#5561)
close tikv/pd#5538

Signed-off-by: bufferflies <1045931706@qq.com>
2022-10-26 20:25:57 +08:00
Ryan Leung 6c76647809
schedule: refine the operator priority (#5575)
close tikv/pd#5388

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2022-10-12 13:53:51 +08:00
Ryan Leung 2adb979747
*: fmt the code using go1.19 (#5435)
close tikv/pd#5454

Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>

Co-authored-by: nolouch <nolouch@gmail.com>
2022-08-26 20:48:21 +08:00
Yongbo Jiang 0433eea9bf
schedule: Schedule plan interface and plan collector (#5280)
ref tikv/pd#5257, ref tikv/pd#5402

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2022-08-24 00:00:21 +08:00
Ryan Leung 8307fe8878
*: fix some typo issues (#5390)
close tikv/pd#5389

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2022-08-03 13:44:05 +08:00
Yongbo Jiang 05444e2dd4
*: region filter (#5135)
ref tikv/pd#5257

remove `RegionOption`, and add `RegionFilter`

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
2022-07-15 11:15:06 +08:00
Ryan Leung 0dcf858cb7
schedule: change the interface of `Schedule` (#5228)
ref tikv/pd#5257

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2022-07-05 11:09:03 +08:00
Ryan Leung 4fc7ede5c6
*: replace all string literal with constant (#5262)
ref tikv/pd#4399

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2022-07-04 16:25:01 +08:00
Ryan Leung 45d7867323
*: use build tag to manage deadlock check (#4863)
close tikv/pd#4867

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2022-04-28 14:08:51 +08:00
JmPotato d87d0b355f
*: introduce the new Storage interface (#4335)
* Introduce the new Storage interface (ref #3453)

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Add some comments

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Split the new Storage interface

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Move out the Storage interface from the core package

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Split the storage definations

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Add a TODO

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Replace the old core.storage (most of them)

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Fix the check

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Fix the region check test

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Use the storage.Builder to create a storage

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Refactor the storage builder

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Refactor the PD storage

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Fix the test

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Rename the base storage definitions

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Address the comment

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Address the comment

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ShuNing <nolouch@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2022-01-14 19:29:43 +08:00
disksing 32832a3fe1
build: reorg Makefile (#4574)
* build: reorg Makefile

ref #4399

Signed-off-by: disksing <i@disksing.com>

* minor update

Signed-off-by: disksing <i@disksing.com>

* minor fix

Signed-off-by: disksing <i@disksing.com>

* add back daily coverage

Signed-off-by: disksing <i@disksing.com>
2022-01-14 13:33:43 +08:00
Ryan Leung 3792f0751d
*: remove opt package totally (#4535)
* remove IsFeatureSupported interface

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* remove opt package totally

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* address the comment

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* address comments

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* add lock back

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* rename and simplify

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2022-01-14 10:29:43 +08:00
Croxx b140104a19
schedulers: evict leader support multiple targets (#4401)
* upgrate pingcap/check dep

Signed-off-by: MrCroxx <mrcroxx@outlook.com>

* add multi-target support in TransferLeader

Add a new field `Peers` in `TransferLeader` to support
multi-target evict leader. During building steps,
`targetLeaderStoreIDs` is only used by multi-target
evict leader, so the field will not be filtered by
joint/not-joint rules.

Close #4229 .

Signed-off-by: MrCroxx <mrcroxx@outlook.com>

* add multi target transfer leader test

Signed-off-by: MrCroxx <mrcroxx@outlook.com>

* fix SetLeaders validation

Signed-off-by: MrCroxx <mrcroxx@outlook.com>

* fix bugs

Signed-off-by: MrCroxx <mrcroxx@outlook.com>

* fix build

Signed-off-by: MrCroxx <mrcroxx@outlook.com>

* refactor code

Signed-off-by: MrCroxx <mrcroxx@outlook.com>

* fix build

Signed-off-by: MrCroxx <mrcroxx@outlook.com>
2022-01-10 12:27:41 +08:00
Ryan Leung 632742fd49
*: move some functions from `opt` to `schedule` (#4517)
Signed-off-by: Ryan Leung <rleungx@gmail.com>
2021-12-30 16:05:50 +08:00
JmPotato 1555c2e615
schedule: remove unnecessary schedule/opt functions (#4356)
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2021-11-22 16:25:59 +08:00
disksing 20b00a7c49
*: fix license (#3996)
Signed-off-by: disksing <i@disksing.com>
2021-08-17 18:48:00 +08:00
Ryan Leung 2b2d88636d
fix some lints (#3980)
Signed-off-by: Ryan Leung <rleungx@gmail.com>
2021-08-13 01:13:56 +08:00
JmPotato c484c143e3
*: prealloc some slices to reduce allocation during the runtime (#3669)
* Prealloc some slices to reduce allocation during the runtime

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Fix the test

Signed-off-by: JmPotato <ghzpotato@gmail.com>
2021-05-15 15:35:38 +08:00
Song Gao c7aac75346
scheduler: add operatorLimitCounter metrics for each scheduler (#3367) 2021-01-22 17:43:57 +08:00