-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
config: add pd client option to enable request redirection #23025
Conversation
/run-all-tests |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
config/config.go
Outdated
@@ -176,6 +176,9 @@ type Config struct { | |||
// EnableTCP4Only enables net.Listen("tcp4",...) | |||
// Note that: it can make lvs with toa work and thus tidb can get real client ip. | |||
EnableTCP4Only bool `toml:"enable-tcp4-only" json:"enable-tcp4-only"` | |||
// The client will forward the requests to the PD or allocator leader through the follower |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should be updated to be more generic as it doesn't just control the behavior of PD client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I forgot about it.
/run-all-tests |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@nolouch: Please use If you have approved this PR, please ignore this reply. This reply is being used as a temporary reply during the migration of the new bot and will be removed on April 1. 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 ti-community-infra/tichi repository. |
@nolouch: In response to this:
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 ti-community-infra/tichi repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
config/config_test.go
Outdated
@@ -278,6 +278,7 @@ spilled-file-encryption-method = "plaintext" | |||
c.Assert(conf.Security.SpilledFileEncryptionMethod, Equals, SpilledFileEncryptionMethodPlaintext) | |||
c.Assert(conf.DeprecateIntegerDisplayWidth, Equals, true) | |||
c.Assert(conf.EnableEnumLengthLimit, Equals, false) | |||
c.Assert(conf.EnableForwarding, Equals, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test, you should try to set the value to a non-default value in the config text above, and assert it's actually set to a non-default value. So you should add enable-forwarding=true
at about L200 and assert it's true here.
store/driver/tikv_driver.go
Outdated
@@ -24,6 +24,7 @@ import ( | |||
"time" | |||
|
|||
"github.com/pingcap/errors" | |||
tidbconfig "github.com/pingcap/tidb/config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that you may need to check if it breaks the work about extracting the tikvclient out from tidb repo.
cc @disksing
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
/label needs-cherry-pick-5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@MyonKeminta: Please use If you have approved this PR, please ignore this reply. This reply is being used as a temporary reply during the migration of the new bot and will be removed on April 1. 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 ti-community-infra/tichi repository. |
@MyonKeminta: In response to this:
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 ti-community-infra/tichi repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@AndreMouche: Please use If you have approved this PR, please ignore this reply. This reply is being used as a temporary reply during the migration of the new bot and will be removed on April 1. 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 ti-community-infra/tichi repository. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 641755d
|
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #23358 |
What problem does this PR solve?
Problem Summary:
When there is a network partition problem happens between TiDB and PD or allocator leader, it can not serve anymore at the moment.
What is changed and how it works?
What's Changed:
How it Works: This PR is going to add an option to make PD client can redirect the requests to PD or allocator leader if there is a network partition problem.
This PR should be merged after tikv/pd#3431 is merged.
Tests
Release note