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>
closetikv/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>
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>
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>
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>
closetikv/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>
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>
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>
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>
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>
closetikv/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>
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>
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>
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>