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: fix tidb version showed in cluster_info table and update the go.mod for new sysutil (#16003) #18413

Merged
merged 6 commits into from
Jul 28, 2020

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Jul 7, 2020

cherry-pick #16003 to release-4.0


What problem does this PR solve?

close #16302

The version of TiDB is not consistent with TiKV and PD.

What is changed and how it works?

Proposal: xxx

What's Changed:
before:

+------+-----------------+-----------------+----------------------------------------+------------------------------------------+---------------------------+--------------------+
| TYPE | INSTANCE        | STATUS_ADDRESS  | VERSION                                | GIT_HASH                                 | START_TIME
          | UPTIME             |
+------+-----------------+-----------------+----------------------------------------+------------------------------------------+---------------------------+--------------------+
| tidb | 0.0.0.0:4000    | 0.0.0.0:10080   | 5.7.25-TiDB-v4.0.0-beta-613-gaa7ef9c46 | aa7ef9c46435bb20d42fa0badcf09fc16f9609a9 | 2020-04-02T15:35:56+08:00 | 8.410056522s       |
| pd   | 127.0.0.1:2379  | 127.0.0.1:2379  | 4.0.0-beta.2                           | 7ebad5232e7df681d8d425900f52984574539568 | 2020-04-02T10:15:36+08:00 | 5h20m28.410060208s |
| tikv | 127.0.0.1:20160 | 127.0.0.1:20180 | 4.0.0-beta.2                           | 7908f6e6699239fff23daa444961b5a47ff659da | 2020-04-02T10:15:49+08:00 | 5h20m15.410061844s |
+------+-----------------+-----------------+----------------------------------------+------------------------------------------+---------------------------+--------------------+

this pr : not set the serverVersion, use select Version() would get the default version. And CLUSTER_INFO would get the format version.

mysql root@localhost:INFORMATION_SCHEMA> select Version()
+----------------------------------------------+
| Version()                                    |
+----------------------------------------------+
| 5.7.25-TiDB-v4.0.0-beta-630-g91effa93d-dirty |
+----------------------------------------------+
1 row in set
Time: 0.030s

mysql root@localhost:INFORMATION_SCHEMA> select * from `CLUSTER_INFO`
+------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+--------------------+
| TYPE | INSTANCE        | STATUS_ADDRESS  | VERSION      | GIT_HASH                                 | START_TIME                | UPTIME             |
+------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+--------------------+
| tidb | 0.0.0.0:4000    | 0.0.0.0:10080   | 4.0.0-beta   | 91effa93d86cf0bb7545e9d59f6a1767b1bfdce5 | 2020-04-07T21:21:18+08:00 | 1m39.481884397s    |
| pd   | 127.0.0.1:2379  | 127.0.0.1:2379  | 4.0.0-beta.2 | 7ebad5232e7df681d8d425900f52984574539568 | 2020-04-07T11:59:11+08:00 | 9h23m46.481888567s |
| tikv | 127.0.0.1:20160 | 127.0.0.1:20180 | 4.0.0-beta.2 | 7908f6e6699239fff23daa444961b5a47ff659da | 2020-04-07T11:59:31+08:00 | 9h23m26.48189004s  |
+------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+--------------------+
3 rows in set
Time: 0.033s

When set the serverVersion to "8.0.1" in config.toml, select Version() and CLUSTER_INFO would get the version which user set:

mysql root@localhost:INFORMATION_SCHEMA> select Version()
+-----------+
| Version() |
+-----------+
| 8.0.1     |
+-----------+
1 row in set
Time: 0.033s

mysql root@localhost:INFORMATION_SCHEMA> select * from `CLUSTER_INFO`
+------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+--------------------+
| TYPE | INSTANCE        | STATUS_ADDRESS  | VERSION      | GIT_HASH                                 | START_TIME                | UPTIME             |
+------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+--------------------+
| tidb | 0.0.0.0:4000    | 0.0.0.0:10080   | 8.0.1        | None                                     | 2020-04-07T21:25:55+08:00 | 59.239367762s      |
| pd   | 127.0.0.1:2379  | 127.0.0.1:2379  | 4.0.0-beta.2 | 7ebad5232e7df681d8d425900f52984574539568 | 2020-04-07T11:59:11+08:00 | 9h27m43.239373343s |
| tikv | 127.0.0.1:20160 | 127.0.0.1:20180 | 4.0.0-beta.2 | 7908f6e6699239fff23daa444961b5a47ff659da | 2020-04-07T11:59:31+08:00 | 9h27m23.239374837s |
+------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+--------------------+
3 rows in set

How it Works:

Check List

Tests

  • Unit test

Release note

  • Fix issues of TiDB version information formation doesn't consistent with PD/TiKV in cluster_info table.

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@zimulala please accept the invitation then you can push to the cherry-pick pull requests.
https://github.com/ti-srebot/tidb/invitations

@sre-bot
Copy link
Contributor

sre-bot commented Jul 7, 2020

Signed-off-by: crazycs520 <[email protected]>
@sre-bot
Copy link
Contributor

sre-bot commented Jul 7, 2020

@crazycs520
Copy link
Contributor

/rebuild

Copy link
Contributor

@crazycs520 crazycs520 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 Jul 7, 2020
@ti-srebot
Copy link
Contributor Author

@crazycs520,Thanks for your review.

@crazycs520 crazycs520 removed the sig/execution SIG execution label Jul 7, 2020
Copy link
Contributor

@zimulala zimulala 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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 7, 2020
@ti-srebot
Copy link
Contributor Author

@zimulala,Thanks for your review.

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

/run-all-tests

@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 Jul 7, 2020
@ti-srebot
Copy link
Contributor Author

@tangenta,Thanks for your review.

@github-actions github-actions bot added the sig/execution SIG execution label Jul 7, 2020
@crazycs520
Copy link
Contributor

/run-integration-br-test

@crazycs520
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @crazycs520, you don't have permission to trigger auto merge event on this branch.

@crazycs520 crazycs520 removed the sig/execution SIG execution label Jul 7, 2020
@crazycs520
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @crazycs520, you don't have permission to trigger auto merge event on this branch.

@crazycs520
Copy link
Contributor

/rebuild

@github-actions github-actions bot added the sig/execution SIG execution label Jul 7, 2020
@zimulala
Copy link
Contributor

zimulala commented Jul 7, 2020

/merge

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

@zz-jason zz-jason modified the milestones: v4.0.2, v4.0.3 Jul 10, 2020
@qw4990 qw4990 removed their request for review July 10, 2020 08:12
@winoros winoros modified the milestones: v4.0.3, v4.0.4 Jul 15, 2020
@imtbkcat imtbkcat modified the milestones: v4.0.4, v4.0.5 Jul 28, 2020
@zz-jason
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor Author

Your auto merge job has been accepted, waiting for:

  • 18806
  • 18667
  • 18368
  • 17926
  • 17823
  • 18531
  • 18667
  • 18806

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@zz-jason
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor Author

Your auto merge job has been accepted, waiting for:

  • 18434
  • 18280
  • 18121
  • 18122
  • 18027
  • 18234
  • 18529
  • 18727
  • 18583
  • 18513
  • 17972
  • 17231
  • 18692
  • 17988
  • 18683
  • 18159
  • 17863
  • 17823
  • 18531

@ti-srebot ti-srebot merged commit 4bb387d into pingcap:release-4.0 Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution 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/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants