Commit Graph

82 Commits

Author SHA1 Message Date
okJiang 8941decac6
store: replace slow store eviction flags with atomic counters (#9739)
ref tikv/pd#9359

Signed-off-by: okjiang <819421878@qq.com>
2025-09-23 05:11:07 +00:00
Ryan Leung 2d131a509f
mcs: reduce some unnecessary logs (#9623)
ref tikv/pd#5766

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2025-09-04 11:04:21 +00:00
Ryan Leung 6c43bc9081
scheduler: fix the error type (#9712)
ref tikv/pd#9006, close tikv/pd#9713

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2025-09-02 08:44:37 +00:00
okJiang 6152a2483e
store: refactor leader transfer pause logic to use atomic operations (#9675)
close tikv/pd#9673

Signed-off-by: okjiang <819421878@qq.com>
2025-08-21 07:39:35 +00:00
tiancaiamao 7d93890a99
gc: global GC barriers support (#9340)
ref tikv/pd#8978

Signed-off-by: tiancaiamao <tiancaiamao@gmail.com>
2025-08-05 04:07:39 +00:00
Ryan Leung a37367fbc9
mcs: refactor election member interface (part 1) (#9599)
ref tikv/pd#5766

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2025-07-31 08:01:34 +00:00
lhy1024 5507301370
keyspace, tso: disable default keyspace in next-gen (#9499)
ref tikv/pd#9414

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-07-11 09:43:18 +00:00
lhy1024 3de21d3f30
keyspace, tso: add system keyspace for next-gen (#9415)
close tikv/pd#9414

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-06-24 07:52:03 +00:00
lhy1024 9ee8379e78
keyspace, id: fix alloc range and add reserved keyspaces for next-gen (#9423)
ref tikv/pd#9414, close tikv/pd#9417

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-06-23 08:24:48 +00:00
Ryan Leung f792f5d6cf
mcs: fix tls setting for microservices (#9344)
close tikv/pd#9367

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-05-29 06:59:46 +00:00
JmPotato fa843982dd
feat(resourcemanager): implement keyspace manager for resource groups (#9331)
ref tikv/pd#9296

Add keyspace-level resource group management.

Signed-off-by: JmPotato <github@ipotato.me>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-05-21 02:41:01 +00:00
Ryan Leung 748d6c8321
*: print log if fail to close lease (#9181)
ref tikv/pd#4399

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-04-17 08:44:41 +00:00
Ryan Leung aae12d90b9
pkg: remove auto scaling (#9205)
close tikv/pd#9206

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2025-04-16 09:17:06 +00:00
MyonKeminta 9092ccc686
gc: Add `GCStateManager` which is planned to be the replacement of `SafePointManager` (#9169)
ref tikv/pd#8978

Add `GCStateManager` which is planned to be the replacement of `SafePointManager`.

This is part of the refactor task #8978 . The new module is not yet used until the next PR updates the gRPC service interfaces.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-04-08 05:58:49 +00:00
JmPotato fda80ebb96
tso: enhance timestamp persistency with strong leader consistency (#9171)
close tikv/pd#9157

This commit enhances the timestamp storage mechanism by adding a leadership validation check when saving TSO timestamps to etcd.
This prevents a former leader from incorrectly persisting timestamps after losing leadership.

Signed-off-by: JmPotato <github@ipotato.me>
2025-04-01 09:22:28 +00:00
JmPotato 6eac733cee
tso: eliminate unnecessary abstractions in the allocator (#9158)
ref tikv/pd#8802

This commit refactors the TSO allocator components to simplify the architecture:

1. Removed the unnecessary `AllocatorManager` abstraction and its related operations
2. Removed the unnecessary `GlobalTSO term and its related codes
3. Renamed internal methods to be more consistent with their accessibility levels

The refactoring maintains all functionality while making the code more maintainable with fewer abstraction layers.

Signed-off-by: JmPotato <github@ipotato.me>
2025-04-01 07:37:13 +00:00
MyonKeminta 9336139c58
storage: expose etcd's transaction as LowLevelTxn interface to kv.Base (#9016)
ref tikv/pd#8978

Exposes etcd's transactoin API to kv.Base layer. The behavior is also simulated in `MemKV` and `LevelDBKV` to provide the same interface.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2025-02-19 08:12:13 +00:00
JmPotato 5ad4301b7a
client/pkg: introduce the deadline watcher (#8955)
ref tikv/pd#8690

Introduce the deadline watcher.

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2024-12-31 05:54:33 +00:00
Ryan Leung 054a3d43e0
*: unify the gRPC errors (#8910)
ref tikv/pd#8922

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2024-12-25 07:39:39 +00:00
Ryan Leung ecb31de2bc
client: move circuit breaker to `pkg` (#8932)
ref tikv/pd#8678, ref tikv/pd#8690

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-18 09:10:24 +00:00
Ryan Leung 221877d424
*: unify the error definition (#8902)
ref tikv/pd#8922

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2024-12-18 08:50:51 +00:00
okJiang 21a04cb237
tso: remove local tso code part 2 (#8846)
ref tikv/pd#8802

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-25 07:27:08 +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
JmPotato a929a546a7
client/http, api/middleware: enhance the retry logic of the HTTP client (#8229)
ref tikv/pd#7300

Schedule a member change check when the HTTP status code is 503 or receives a leader/primary change error.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
2024-06-03 08:28:25 +00:00
Hu# a8aaae9b2b
member: return err when meet frequently campaign leader (#7566)
close tikv/pd#7562

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-12-20 09:33:23 +00:00
Yongbo Jiang f51f913455
errs: remove redundant `FastGenWithCause` in `ZapError` (#7497)
close tikv/pd#7496

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-12-13 11:27:19 +00:00
Ryan Leung eafc1ed899
mcs: fix TestAllocIDAfterLeaderChange (#7426)
close tikv/pd#7427

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2023-11-24 07:34:13 +00:00
lhy1024 afe6afccf9
mcs: support rules http interface in scheduling server (#7199)
ref tikv/pd#5839

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-10 09:09:42 +00:00
lhy1024 ce0bb5dc39
mcs: support admin/cache http interface in scheduling server (#7279)
ref tikv/pd#5839

Signed-off-by: lhy1024 <admin@liudos.us>
2023-10-30 07:09:35 +00:00
lhy1024 e2f12696c7
util: add check delete json function (#7113)
ref tikv/pd#4399

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-09-21 08:55:46 +00:00
lhy1024 dff99fd4a1
*: decouple operator handler and server (#7089)
ref tikv/pd#5839

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-09-19 06:31:42 +00:00
ShuNing 11b752e0bf
scatter: fix the unexpected error code (#7075)
close tikv/pd#7073

scatter: fix the unexpected error code

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-09-13 18:15:08 +00:00
JmPotato 77d1998214
tso, server: ensure the reset TSO would NOT be updated at all (#7050)
close tikv/pd#7049

Block the TSO update at the very beginning of `UpdateTimestamp` and refine the `updateAfterResetTSO` failpoint.

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-09-06 07:42:42 +00:00
Ryan Leung fbd386a499
server: add gRPC rate limit (#6834)
close tikv/pd#5739, ref tikv/pd#6556

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-08-24 02:48:33 +00:00
glorv 5f7236fb55
resourcemanager: do not check existence when add resource group (#6717)
ref tikv/pd#5851, ref pingcap/tidb#45050

Signed-off-by: glorv <glorvs@163.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-07-03 06:53:12 +00:00
JmPotato 16d3b51a45
tso, tests: implement the keyspace group merge checker (#6625)
ref tikv/pd#6589

Implement the keyspace group merge checker.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
2023-06-25 08:02:34 +00:00
JmPotato 99e241955e
config, cluster: add an option to halt the cluster scheduling (#6498)
ref tikv/pd#6493

Add an option to halt the cluster scheduling.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
2023-05-25 08:35:40 +00:00
Bin Shi b2275f669f
mcs, tso: implement GetMinTS gPRC on both API leader and PD client (#6488)
ref tikv/pd#5895

implement GetMinTS gPRC on both API leader and the PD client.

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
2023-05-22 05:19:37 +00:00
Bin Shi e8de93d6a6
Provide GetMinTS API to solve the compatibility issue brought by multi-timeline tso (#6421)
ref tikv/pd#6142

1. Import kvproto change to introduce GetMinTS rpc in the TSO service.
6. Add server side implementation for GetMinTS rpc.
7. Add client side implementation for GetMinTS rpc.
8. Add unit test

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
2023-05-12 05:04:21 +00:00
Bin Shi 142b47f69a
mcs, tso: support multi-keyspace-group and its service discovery in E2E path (#6321)
ref tikv/pd#6232

Support multi-keyspace-group in PD(TSO) client

Signed-off-by: Bin Shi <binshi.bing@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
2023-04-26 03:53:51 +00:00
JmPotato db9ccbb865
tests, tso: add more TSO split tests (#6338)
ref tikv/pd#6232

Add more TSO split tests.

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

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2023-04-20 11:57:19 +08:00
JmPotato e15b2116ae
tso, member: support TSO split based on keyspace group split (#6313)
ref tikv/pd#6232

Support TSO split based on keyspace group split.

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

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2023-04-18 11:21:19 +08:00
Ryan Leung 36a8e1545d
*: change the log level (#6324)
ref tikv/pd#6232

Signed-off-by: Ryan Leung <rleungx@gmail.com>
2023-04-14 16:35:01 +08:00
Bin Shi f80b215177
Apply multi-keyspace-group membership to tso service and handle inconsistency issue (#6282)
ref tikv/pd#6232

Apply multi-keyspace-group membership to tso service and handle inconsistency issue.

1. Add KeyspaceLookupTable to endpoint.KeyspaceGroup
type KeyspaceGroup struct {
        ...
        // KeyspaceLookupTable is for fast lookup if a given keyspace belongs to this keyspace group.
        // It's not persisted and will be built when loading from storage.
        KeyspaceLookupTable map[uint32]struct{} `json:"-"`
}

2. After loading keyspace groups, the Keyspace Group Manager builds KeyspaceLookupTable for every keyspace groups.

3. When Keyspace Group Manager handles tso requests, it uses the keyspaceLookupTable to check if the required keypsace still belongs to the required keyspace group. If not, returns the current keyspace group id in the tso response header.

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
2023-04-11 15:19:01 +08:00
Bin Shi 6bac6b7a68
Add more failure tests when tso service loading initial keyspace groups assignment (#6280)
ref tikv/pd#6232

Add more failure tests when tso service loading initial keyspace groups assignment

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
2023-04-07 11:20:58 +08:00
Bin Shi 9fcde123fd
Load initial assignment and dynamically watch/apply keyspace groups' membership/distribution change (#6247)
ref tikv/pd#6232

Load initial keyspace group assignment.
Dynamically watch/apply keyspace groups' membership/distribution change.

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
2023-04-06 16:08:58 +08:00
Hu# 19f7dd98b0
resource_manager: implement the token-consuming by client (#6039)
close tikv/pd#5947

- Introduce the token slot to balance the QPS within the same resource group.

Signed-off-by: husharp <jinhao.hu@pingcap.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2023-03-23 17:14:43 +08:00
ShuNing 3150c85f4a
resource_control: create the default resource group (#6206)
ref tikv/pd#4399, ref pingcap/tidb#42403

resource_control: create the default resource group

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

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2023-03-23 14:28:42 +08:00
Liu Cong 756e32cd46
scheduler: new slow store detecting and leader evicting (#5808)
ref tikv/pd#5916

schedulers: new scheduler `evict-slow-trend-scheduler`, for new slow store detecting and leader evicting

Signed-off-by: Liu Cong <innerr@gmail.com>
2023-02-09 09:37:59 +08:00
Yongbo Jiang 6ed3962159
cluster: continuous diagnosis and support balance-region/leader diagnosis (#5471)
ref tikv/pd#5257, ref tikv/pd#5499

change diagnosis mechaism and support balance-region-scheduler

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-09-16 22:38:59 +08:00