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

mysql-compatibility: correct performance_schema statement #19737

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Dec 19, 2024

What is changed, added or deleted? (Required)

The session_connect_attrs table is not empty and the pd%, tidb% and tikv% tables are also not empty.

mysql-8.0.11-TiDB-v8.5.0> SELECT * FROM performance_schema.session_connect_attrs;
+----------------+-----------------+------------+------------------+
| PROCESSLIST_ID | ATTR_NAME       | ATTR_VALUE | ORDINAL_POSITION |
+----------------+-----------------+------------+------------------+
|     2376073220 | _client_name    | libmysql   |                0 |
|     2376073220 | _client_version | 9.1.0      |                1 |
|     2376073220 | _os             | Linux      |                2 |
|     2376073220 | _pid            | 2987910    |                3 |
|     2376073220 | _platform       | x86_64     |                4 |
|     2376073220 | os_user         | dvaneeden  |                5 |
|     2376073220 | program_name    | mysql      |                6 |
+----------------+-----------------+------------+------------------+
7 rows in set (0.00 sec)

mysql-8.0.11-TiDB-v8.5.0>

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.2 (TiDB 8.2 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Copy link

ti-chi-bot bot commented Dec 19, 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 lilin90 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 added the missing-translation-status This PR does not have translation status info. label Dec 19, 2024
@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 19, 2024
Copy link

ti-chi-bot bot commented Dec 20, 2024

@mjonss: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@@ -137,7 +137,7 @@ As shown, because of the shared allocator, the `id` increments by 2 each time. T

<CustomContent platform="tidb">

TiDB utilizes a combination of [Prometheus and Grafana](/tidb-monitoring-api.md) for storing and querying performance monitoring metrics. In TiDB, performance schema tables do not return any results.
TiDB utilizes a combination of [Prometheus and Grafana](/tidb-monitoring-api.md) for storing and querying performance monitoring metrics. In TiDB, most [performance schema tables](/performance-schema/performance-schema.md) do not return any results.
Copy link
Member

Choose a reason for hiding this comment

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

Does this update also apply to the custom content for TiDB Cloud?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

mysql-5.7.28-TiDB-Serverless> TABLE performance_schema.session_variables LIMIT 5;
+-----------------------------------+----------------+
| VARIABLE_NAME                     | VARIABLE_VALUE |
+-----------------------------------+----------------+
| innodb_io_capacity_max            | 2000           |
| tidb_non_prepared_plan_cache_size | 100            |
| version_compile_os                | linux          |
| net_retry_count                   | 10             |
| tidb_current_ts                   | 0              |
+-----------------------------------+----------------+
5 rows in set (0.04 sec)

mysql-5.7.28-TiDB-Serverless> SELECT TIDB_VERSION()\G
*************************** 1. row ***************************
TIDB_VERSION(): Release Version: v7.1.3-serverless
Edition: Community
Git Commit Hash: 2e8be50b073c26b8979c6988a3888ce57b5cec99
Git Branch: release-7.1-serverless
UTC Build Time: 2024-11-22 15:30:17
GoVersion: go1.21.11
Race Enabled: false
TiKV Min Version: 6.1.0
Check Table Before Drop: false
Store: tikv
1 row in set (0.02 sec)

So performance_schema.session_variables is not empty.

performance_schema.session_connect_attrs doesn't exist on TiDB Cloud Serverless, which is because v7.1.3 doesn't yet have this table. TiDB v7.5 does have this table.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like session_variables was introduced in v6.2.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On TiDB Cloud Serverless this is the only table with data.

$ mysqldump -u '4BFMphWRTf5tr4V.root' -h gateway01.eu-central-1.prod.aws.tidbcloud.com -P 4000 -pXXXXXXXXXX --skip-lock-tables --no-create-info performance_schema | awk '/^INSERT/ { print substr($0,0,100) }'
mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- Warning: column statistics not supported by the server.
INSERT INTO `session_variables` VALUES ('tidb_build_stats_concurrency','4'),('tidb_opt_skew_distinct

On TiDB Cloud Dedicated there are most likely more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing-translation-status This PR does not have translation status info. 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.

3 participants