-
Notifications
You must be signed in to change notification settings - Fork 688
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
Update description of tidb_replica_read
variable values for follower read
#18699
Conversation
Welcome @tommygood! |
Hi @tommygood. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1fdc4e0
to
f3095fa
Compare
Sorry for the late response, thanks for your feedback. Some of the functional behavior descriptions mentioned above do indeed differ from the actual code implementation as you have mentioned in this PR. My thought is to separate the description of the functionality design from the error handling logic, as users are primarily concerned with the behavior of the functionality itself. Error handling and retries are part of a more complex internal process (Ref: tikv/client-go#1167) and may require a separate document for detailed explanation. |
Got it, thanks for your response. |
First-time contributors' checklist
What is changed, added or deleted? (Required)
tidb_replica_read
is set toleader
, if the leader replica's kv store is busy, which is partially determined by thetidb_load_based_replica_read_threshold
, then the client-go will select the others replica to read, which can be follower or learner replicas.tidb_load_based_replica_read_threshold
andtidb_replica_read
when set toleader
.tidb_replica_read
is set tofollower
,leader-and-follower
,prefer-leader
, orclosest-replicas
. However, the current documentation only mentions follower reads in these contexts.The doc currently states that :
However, in my test results (under
v8.1.0
), when there are no learner replica andtidb_replica_read
is set tolearner
, mysql client still can read data from tidb.This occurs because client-go will randomly choose the leader or follower replica to read.Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?