Skip to content
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

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

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

djshow832
Copy link
Contributor

@djshow832 djshow832 commented Mar 28, 2024

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

  • Manual test (add detailed scripts or steps below)

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

Copy link
Contributor

ti-chi-bot bot commented Mar 28, 2024

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot requested a review from breezewish March 28, 2024 03:53
@CLAassistant
Copy link

CLAassistant commented Mar 28, 2024

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2024

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.

❗ 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 ⚠️
components/playground/instance/tiflash_config.go 47.06% 8 Missing and 1 partial ⚠️
components/playground/main.go 77.78% 6 Missing ⚠️
components/playground/instance/pd.go 60.00% 4 Missing ⚠️
components/playground/instance/tidb_config.go 66.67% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            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 Coverage Δ
cluster 45.21% <100.00%> (-0.08%) ⬇️
dm 25.54% <50.00%> (+0.05%) ⬆️
playground 16.43% <56.88%> (+0.02%) ⬆️
tiup 33.59% <ø> (ø)
unittest 22.16% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

ti-chi-bot bot commented Mar 28, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-28 03:57:12.789481564 +0000 UTC m=+2126659.811727950: ☑️ agreed by kaaaaaaang.

@ti-chi-bot ti-chi-bot bot added the lgtm label Mar 28, 2024
@kaaaaaaang kaaaaaaang added this to the v1.15.0 milestone Mar 28, 2024
@kaaaaaaang kaaaaaaang merged commit 16d4ac4 into pingcap:master Mar 29, 2024
18 of 19 checks passed
@djshow832 djshow832 deleted the tiproxy_advertise branch March 29, 2024 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants