-
Notifications
You must be signed in to change notification settings - Fork 312
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
Fix PD --peer-urls flag to use listen_host variable #941
Conversation
Codecov Report
@@ Coverage Diff @@
## master #941 +/- ##
=======================================
Coverage 55.66% 55.67%
=======================================
Files 263 263
Lines 19392 19396 +4
=======================================
+ Hits 10795 10799 +4
Misses 6880 6880
Partials 1717 1717
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
245e63c
to
311eb0d
Compare
@9547 Thanks for feedback and suggestions. Updated the tests as requested. First attempt was to create a separate test just for host name support. It turned out the integration tests are quite convoluted and performs some tricks to actually work with IP addresses which are no longer necessary if hostnames are used. In the end all IP addresses in tests were replaced with docker hostnames Key changes that were made since initial commit:
|
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates TLS certificate generator to detect if IP address or hostname was used as host value. Another update is for tests to start using docker host names n1-n5 instead of templating topology with IP addresses. File full_scale_in_tidb.yaml was forked into full_scale_in_tidb_2nd.yaml to avoid rewriting existing file for second tidb scale-out attempt.
Thanks, but could you please split this pr into two or three
thanks again. |
PRs are split. Just noticed that I have overlooked the request to have mixed IP and host name tests. Mixing host names and IP addresses in tests is not that trivial. If we mix host names and IP address in a single topology - tiup-cluster will treat them as different hosts and complain about ports being already in use by external services. Leaving some tests with host names while other test with IP addresses also causes issue because full.yaml is shared between scale and cmd tests. Is there any chance full test suite switch to host names would be accepted 😄 ? Alternatively would a simple test of just building a minimal cluster and tearing it down using only IP addresses suffice? My opinion is that if we have code that works with host names it should with high confidence work with IP addresses as well without explicit testing. |
@fln: PR needs rebase. 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. |
Closing this PR, it is replaced by: |
What problem does this PR solve?
This allows us to use server hostname instead of IP address. Without
this change if PD service is declared using hostname it fails to start,
reporting an error that it can not bind to given interface.
Metadata variable
listen_host
was introduced in #495 and is already used forthe --client-urls flag.
This should resolve #337 and partially implement #691 .
What is changed and how it works?
This commit updates run_pd.sh template to use
listen_host
for--peer-urls flag instead of
host
.Check List
Tests
Side effects
If existing installations relied on
host
field to be used as address for accepting peer connections this change could be treated as breaking change. Default value oflisten_host
is 0.0.0.0 so it should not break existing clusters.Some might want to use different listen addresses for peer and client connections. However I think this would add unnecessary complexity and not worth supporting.
Related changes
Not sure where metadata file is properly documented. So far I have used source code to understand what is expected in the metadata.yaml file.
Release notes: