pingcap / tiup

A component manager for TiDB
https://tiup.io
Apache License 2.0
409 stars 304 forks source link

cluster, playground: add config `advertise-addr` to tiproxy #2392

Closed djshow832 closed 3 months ago

djshow832 commented 3 months ago

What problem does this PR solve?

2391

TiProxy reports its IP, instead of its DNS to ETCD.

What is changed and how it works?

Add config advertise-addr to tiproxy spec. Note that it's compatible with old TiProxy versions because TiProxy won't report errors if there's an unknown config.

Check List

Tests

With Playground:

MySQL [information_schema]> select * from cluster_config where key like '%advertise%';
+---------+---------------------+------------------------------+---------------------------+
| TYPE    | INSTANCE            | KEY                          | VALUE                     |
+---------+---------------------+------------------------------+---------------------------+
| tidb    | 10.233.90.245:4000  | advertise-address            | 10.233.90.245             |
| pd      | 10.233.90.245:2379  | advertise-client-urls        | http://10.233.90.245:2379/ |
| pd      | 10.233.90.245:2379  | advertise-peer-urls          | http://10.233.90.245:2380/ |
| tikv    | 10.233.90.245:20160 | server.advertise-addr        | 10.233.90.245:20160       |
| tikv    | 10.233.90.245:20160 | server.advertise-status-addr |                           |
| tiproxy | 10.233.90.245:6000  | proxy.advertise-addr         | 10.233.90.245             |
+---------+---------------------+------------------------------+---------------------------+
6 rows in set (0.01 sec)

With Cluster:

MySQL [information_schema]> select * from cluster_config where key like '%advertise%';
+---------+-------------------+------------------------------+----------------------+
| TYPE    | INSTANCE          | KEY                          | VALUE                |
+---------+-------------------+------------------------------+----------------------+
| tidb    | tidb-peer:4000    | advertise-address            | tidb-peer            |
| pd      | pd-peer:2379      | advertise-client-urls        | https://pd-peer:2379/ |
| pd      | pd-peer:2379      | advertise-peer-urls          | https://pd-peer:2380/ |
| tikv    | tikv-peer:20160   | server.advertise-addr        | tikv-peer:20160      |
| tikv    | tikv-peer:20160   | server.advertise-status-addr | tikv-peer:20180      |
| tiproxy | tiproxy-peer:6000 | proxy.advertise-addr         | tiproxy-peer         |
+---------+-------------------+------------------------------+----------------------+
6 rows in set (0.05 sec)

Code changes

None

Side effects

None

Related changes

None

Release notes:

NONE
ti-chi-bot[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign kaaaaaaang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/pingcap/tiup/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 58.71560% with 45 lines in your changes are missing coverage. Please review.

Project coverage is 55.95%. Comparing base (ddbbc4d) to head (5171187). Report is 2 commits behind head on master.

:exclamation: Current head 5171187 differs from pull request most recent head b365889. Consider uploading reports for the commit b365889 to get more accurate results

Files Patch % Lines
components/playground/playground.go 35.29% 21 Missing and 1 partial :warning:
components/playground/instance/tiflash_config.go 47.06% 8 Missing and 1 partial :warning:
components/playground/main.go 77.78% 6 Missing :warning:
components/playground/instance/pd.go 60.00% 4 Missing :warning:
components/playground/instance/tidb_config.go 66.67% 3 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2392 +/- ## ========================================== - Coverage 56.01% 55.95% -0.05% ========================================== Files 329 329 Lines 35154 35156 +2 ========================================== - Hits 19688 19670 -18 - Misses 13113 13135 +22 + Partials 2353 2351 -2 ``` | [Flag](https://app.codecov.io/gh/pingcap/tiup/pull/2392/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [cluster](https://app.codecov.io/gh/pingcap/tiup/pull/2392/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `45.21% <100.00%> (-0.08%)` | :arrow_down: | | [dm](https://app.codecov.io/gh/pingcap/tiup/pull/2392/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `25.54% <50.00%> (+0.05%)` | :arrow_up: | | [playground](https://app.codecov.io/gh/pingcap/tiup/pull/2392/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `16.43% <56.88%> (+0.02%)` | :arrow_up: | | [tiup](https://app.codecov.io/gh/pingcap/tiup/pull/2392/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `33.59% <ø> (ø)` | | | [unittest](https://app.codecov.io/gh/pingcap/tiup/pull/2392/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `22.16% <0.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ti-chi-bot[bot] commented 3 months ago

[LGTM Timeline notifier]

Timeline: