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

infoschema: resolve loopback address of node (#20546) #20850

Merged
merged 4 commits into from
Nov 25, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #20546 to release-4.0


Signed-off-by: crazycs520 [email protected]

What problem does this PR solve?

fix #20528

When Using tiup to deploy a TiDB cluster, the ip of TiKV status-address is 0.0.0.0. then query the cluster_config system will return error.

information_schema> select * from cluster_info;
+------+----------------------+-----------------------+--------------+------------------------------------------+---------------------------+--------------+
| TYPE | INSTANCE             | STATUS_ADDRESS        | VERSION      | GIT_HASH                                 | START_TIME                | UPTIME       |
+------+----------------------+-----------------------+--------------+------------------------------------------+---------------------------+--------------+
| tidb | 192.168.220.171:4000 | 192.168.220.171:10080 | 4.0.0-beta.2 | 79327861bad9b91cca3aa8972e6daaa34bcea526 | 2020-10-20T20:10:56+08:00 | 12.676844s   |
| tidb | 10.0.1.8:4000        | 10.0.1.8:10080        | 4.0.0-beta.2 | 937949f44d0d25e21f5a5722dbb334773de38db9 | 2020-10-20T20:09:33+08:00 | 1m35.676847s |
| pd   | 10.0.1.8:2379        | 10.0.1.8:2379         | 4.1.0-alpha  | 4252d7efe4b1f0f32421f2ffd142b540e6396944 | 2020-10-20T20:09:26+08:00 | 1m42.676849s |
| tikv | 10.0.1.8:20160       | 0.0.0.0:20180         | 4.1.0-alpha  | 482bd12170a1802941bbd1ceed37c0672341c4ab | 2020-10-20T20:09:28+08:00 | 1m40.67685s  |
+------+----------------------+-----------------------+--------------+------------------------------------------+---------------------------+--------------+
information_schema> select * from cluster_config where type='tikv' and `key` like '%pool%' limit 2;
+------+----------+-----+-------+
| TYPE | INSTANCE | KEY | VALUE |
+------+----------+-----+-------+
0 rows in set
Time: 0.027s
information_schema> show warnings;
+---------+------+----------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                |
+---------+------+----------------------------------------------------------------------------------------+
| Warning | 1105 | Get "http://0.0.0.0:20180/config": dial tcp 0.0.0.0:20180: connect: connection refused |
+---------+------+----------------------------------------------------------------------------------------+
1 row in set

What is changed and how it works?

Normally, start tikv with specified advertise-status-addr parameter will be ok, but advertise-status-addr doesn't exist before tikv/tikv#7944, so TiUP can't specify the advertise-status-addr by default.

So, I have to fix this in TiDB. In this PR:

information_schema> select * from cluster_info;
+------+----------------------+-----------------------+--------------+------------------------------------------+---------------------------+--------------+
| TYPE | INSTANCE             | STATUS_ADDRESS        | VERSION      | GIT_HASH                                 | START_TIME                | UPTIME       |
+------+----------------------+-----------------------+--------------+------------------------------------------+---------------------------+--------------+
| tidb | 192.168.220.171:4000 | 192.168.220.171:10080 | 4.0.0-beta.2 | 41e29e8f3351896ddef8f33e587c280cb68ac658 | 2020-10-20T20:11:27+08:00 | 17.601069s   |
| tidb | 10.0.1.8:4000        | 10.0.1.8:10080        | 4.0.0-beta.2 | 937949f44d0d25e21f5a5722dbb334773de38db9 | 2020-10-20T20:09:33+08:00 | 2m11.601073s |
| pd   | 10.0.1.8:2379        | 10.0.1.8:2379         | 4.1.0-alpha  | 4252d7efe4b1f0f32421f2ffd142b540e6396944 | 2020-10-20T20:09:26+08:00 | 2m18.601074s |
| tikv | 10.0.1.8:20160       | 10.0.1.8:20180        | 4.1.0-alpha  | 482bd12170a1802941bbd1ceed37c0672341c4ab | 2020-10-20T20:09:28+08:00 | 2m16.601075s |
+------+----------------------+-----------------------+--------------+------------------------------------------+---------------------------+--------------+
4 rows in set
Time: 0.018s
information_schema> select * from cluster_config where type='tikv' and `key` like '%pool%' limit 1;
+------+----------------+---------------------------+-------+
| TYPE | INSTANCE       | KEY                       | VALUE |
+------+----------------+---------------------------+-------+
| tikv | 10.0.1.8:20160 | raftstore.apply-pool-size | 2     |
+------+----------------+---------------------------+-------+
1 row in set
Time: 0.016s
information_schema> show warnings;
+-------+------+---------+
| Level | Code | Message |
+-------+------+---------+
0 rows in set

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Manual test

Side effects

  • No

Release note

  • Fix issue of status address is a loopback address when querying system cluster tables.

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@wjhuang2016
Copy link
Member

@crazycs520 Please resolve the conflict.

@crazycs520
Copy link
Contributor

/run-all-tests

@crazycs520
Copy link
Contributor

/run-sqllogic-test-2
/run-unit-test

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 5, 2020
@lysu
Copy link
Contributor

lysu commented Nov 9, 2020

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 9, 2020
@breezewish

This comment has been minimized.

@breezewish

This comment has been minimized.

@winoros
Copy link
Member

winoros commented Nov 19, 2020

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @winoros, this branch cannot be merged without an approval of release maintainers

Copy link
Contributor

@tiancaiamao tiancaiamao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/run-unit-test

infoschema/tables_test.go Show resolved Hide resolved
@tiancaiamao
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @tiancaiamao, this branch cannot be merged without an approval of release maintainers

@bb7133
Copy link
Member

bb7133 commented Nov 25, 2020

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @bb7133, this branch cannot be merged without an approval of release maintainers

@ti-srebot ti-srebot added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Nov 25, 2020
@bb7133
Copy link
Member

bb7133 commented Nov 25, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 25, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit 3fe77c6 into pingcap:release-4.0 Nov 25, 2020
@tiancaiamao tiancaiamao deleted the release-4.0-b9ef68e0bd0f branch November 25, 2020 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. type/bugfix This PR fixes a bug. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants