-
Notifications
You must be signed in to change notification settings - Fork 726
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
Activate Follower-Handle #7431
Labels
report/customer
Customers have encountered this bug.
type/development
The issue belongs to a development tasks
Comments
This was referenced Nov 24, 2023
ti-chi-bot bot
added a commit
that referenced
this issue
Nov 29, 2023
ref #7431 Signed-off-by: Cabinfever_B <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot
added a commit
that referenced
this issue
Nov 30, 2023
ref #7431 Signed-off-by: Cabinfever_B <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot
added a commit
that referenced
this issue
Dec 21, 2023
ref #7431, ref #7576 Signed-off-by: Cabinfever_B <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot
added a commit
that referenced
this issue
Dec 29, 2023
ref #7431 Signed-off-by: Cabinfever_B <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
pingandb
pushed a commit
to pingandb/pd
that referenced
this issue
Jan 18, 2024
…7432) ref tikv#7431 Signed-off-by: Cabinfever_B <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com> Signed-off-by: pingandb <[email protected]>
Since we have no plans to support more APIs at this time, I close this issue |
/found customer |
17 tasks
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
report/customer
Customers have encountered this bug.
type/development
The issue belongs to a development tasks
Development Task
PD serves as the central node and provides services for the cluster. In the past, PD leaders have been carrying all the services and follower resources have not been utilized.
Summary
An important function of PD is to provide routing information for data replicas. For example, GetRegion is a hot path in TiDB cluster. The pd provides the sync region mechanism. The pd leader synchronizes the region with the changed meta information to a follower. So we can handle the region requeset in PD follower server.
Additional knowledge
Sync region
The pd provides the sync region mechanism. The pd leader synchronizes the region with the changed meta information to a follower.
And the followers hold basicCluster which has region tree.
Follower forward mechanism
When enable-forwarding is enabled (the default value in TiDB is false), the pd periodically checks the connectivity and health status of the pd leader. If false, pd client will try to send request with pd-forwarded-hostto followers and followers will forward the request to the leader.
Region Cache in TiKV client-go
The region cache deletes a region item in either of the following situations:
Therefore, if a region is unavailable in client-Go, the client does not delete the old region first and then find a new region
design
There may be a delay in synchronizing region data to followers. As a result, the followers data is not up-to-date. To reduce potential retries on the associated path, callers need to select followers or leaders according to the usage scenario.
Specifically, if the caller wants to obtain a new region first time, it can do so from the followers (we can assume that most of the region information in the followers is up to date). If the caller needs to update the region information, we think that this time must get the latest, then this time from the leader.
According to above additional knowledge, this transformation is very easy to do in client-go.
implement
Client-go Impl
PD Client Implement
ServiceClient
#7489 syncer: add region syncer client status #7461ServiceClient
#7489 vars: addpd_enable_follower_handle_region
to support get region from pd follower pingcap/tidb#49231Server Implement
GetRegion
and other region api #7432metrics
#7619
The text was updated successfully, but these errors were encountered: