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

*: add START_TIME and UPTIME columns to system table CLUSTER_INFO #14718

Merged
merged 10 commits into from
Feb 12, 2020
Merged

*: add START_TIME and UPTIME columns to system table CLUSTER_INFO #14718

merged 10 commits into from
Feb 12, 2020

Conversation

lonng
Copy link
Contributor

@lonng lonng commented Feb 11, 2020

What problem does this PR solve?

This PR resolves issues #14707

What is changed and how it works?

  1. Report the start timestamp of TiKV to PD (server: report the start timestamp of current node to PD tikv/tikv#6581).
  2. Save TiKV start timestamp in PD and provide an HTTP API to retrieve the start timestamp of TiKV and PD (server: add start_timestamp for cluster components tikv/pd#2116).
  3. Add two columns (START_TIME and UPTIME) to the system table information_schema.cluster_info

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
mysql> select * from cluster_info;
+------+-----------------+-----------------+----------------------------------------------+------------------------------------------+---------------------------+-----------------+
| TYPE | INSTANCE        | STATUS_ADDRESS  | VERSION                                      | GIT_HASH                                 | START_TIME                | UPTIME          |
+------+-----------------+-----------------+----------------------------------------------+------------------------------------------+---------------------------+-----------------+
| tidb | 0.0.0.0:49920   | 0.0.0.0:12080   | 5.7.25-TiDB-v4.0.0-beta-100-g75bfcb6c5-dirty | 75bfcb6c5ddeac8f0d0a083929f306001ce69b5f | 2020-02-11T07:57:04+08:00 | 1m15.941958783s |
| tidb | 0.0.0.0:49900   | 0.0.0.0:10080   | 5.7.25-TiDB-v4.0.0-beta-100-g75bfcb6c5-dirty | 75bfcb6c5ddeac8f0d0a083929f306001ce69b5f | 2020-02-11T07:56:32+08:00 | 1m47.941966943s |
| pd   | 127.0.0.1:49901 | 127.0.0.1:49901 | 4.0.0-alpha                                  | d1cf01e084d40b7a07aa9a7c9890175a97815448 | 2020-02-11T07:56:27+08:00 | 1m52.94196873s  |
| tikv | 127.0.0.1:49903 | 127.0.0.1:49904 | 4.0.0-alpha                                  | 8af4016554b05de9334b1b821145fa92941b660d | 2020-02-11T07:56:37+08:00 | 1m42.941970325s |
+------+-----------------+-----------------+----------------------------------------------+------------------------------------------+---------------------------+-----------------+
4 rows in set (0.09 sec)

Release note

  • Add two columns (START_TIME and UPTIME) to the system table information_schema.cluster_info

Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
@lonng lonng added type/enhancement The issue or PR belongs to an enhancement. component/infoschema labels Feb 11, 2020
@lonng lonng added this to the v4.0.0-beta.1 milestone Feb 11, 2020
Signed-off-by: Lonng <heng@lonng.org>
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

Signed-off-by: Lonng <heng@lonng.org>
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

@lonng
Copy link
Contributor Author

lonng commented Feb 12, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 12, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Feb 12, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Feb 12, 2020

@lonng merge failed.

@lonng
Copy link
Contributor Author

lonng commented Feb 12, 2020

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Feb 12, 2020

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/infoschema status/can-merge Indicates a PR has been approved by a committer. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants