Skip to content

v8.5.7: support logging session connect attrs to slow query log (#22547)#22775

Merged
ti-chi-bot[bot] merged 4 commits into
pingcap:feature/preview-v8.5.7from
ti-chi-bot:cherry-pick-22547-to-release-8.5
Jun 30, 2026
Merged

v8.5.7: support logging session connect attrs to slow query log (#22547)#22775
ti-chi-bot[bot] merged 4 commits into
pingcap:feature/preview-v8.5.7from
ti-chi-bot:cherry-pick-22547-to-release-8.5

Conversation

@ti-chi-bot

@ti-chi-bot ti-chi-bot commented Apr 17, 2026

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #22547

First-time contributors' checklist

What is changed, added or deleted? (Required)

This PR updates docs according to pingcap/tidb#66617:

  • Add Session_connect_attrs (json) to the schema examples of INFORMATION_SCHEMA.SLOW_QUERY and INFORMATION_SCHEMA.CLUSTER_SLOW_QUERY.
  • Add the system variable doc for performance_schema_session_connect_attrs_size (default/range/-1 behavior/truncation/1 MiB hard limit note).
  • Add status variable docs:
    • Performance_schema_session_connect_attrs_longest_seen
    • Performance_schema_session_connect_attrs_lost
  • Update SESSION_CONNECT_ATTRS doc with size limit and truncation behavior.

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)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 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)

What is the related PR or file 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

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. labels Apr 17, 2026
@ti-chi-bot

Copy link
Copy Markdown
Member Author

@jiong-nba This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@ti-chi-bot

ti-chi-bot Bot commented Apr 17, 2026

Copy link
Copy Markdown

@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.

Details

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 17, 2026
@hfxsd hfxsd assigned hfxsd and unassigned jiong-nba Apr 17, 2026
@hfxsd hfxsd requested a review from yibin87 April 17, 2026 02:59

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces documentation for logging session connection attributes to the slow query log, including new system and status variables such as performance_schema_session_connect_attrs_size. Critical issues were identified where Git conflict markers were left in the SLOW_QUERY and CLUSTER_SLOW_QUERY table schemas, which must be resolved. Additionally, several sections require updates to use active voice and the second person to comply with the documentation style guide.

The output is as follows:

```sql
<<<<<<< HEAD

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This file contains Git conflict markers (e.g., <<<<<<< HEAD, =======, >>>>>>>) inside the SQL code blocks. These markers indicate a failed merge or cherry-pick and must be resolved before the documentation can be published. Please remove the markers and the redundant old table schema, keeping only the updated version.

References
  1. Technical accuracy and completeness are essential for documentation quality. (link)

The output is as follows:

```sql
<<<<<<< HEAD

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Similar to the SLOW_QUERY table above, the CLUSTER_SLOW_QUERY section also contains Git conflict markers that need to be resolved. Ensure that only the correct, updated table schema is displayed in the final output.

Comment thread performance-schema/performance-schema-session-connect-attrs.md
Comment thread system-variables.md
Comment thread system-variables.md Outdated
Comment thread system-variable-reference.md Outdated
Comment thread performance-schema/performance-schema-session-connect-attrs.md Outdated
Comment thread information-schema/information-schema-slow-query.md Outdated
@ti-chi-bot ti-chi-bot Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 17, 2026
@ti-chi-bot ti-chi-bot Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 17, 2026
@hfxsd hfxsd changed the title docs: support logging session connect attrs to slow query log (#22547) [v8.5.7]docs: support logging session connect attrs to slow query log (#22547) Apr 20, 2026
@hfxsd hfxsd added the needs-cherry-pick-master Should cherry pick this PR to master branch. label Apr 20, 2026
@lilin90 lilin90 changed the title [v8.5.7]docs: support logging session connect attrs to slow query log (#22547) v8.5.7: support logging session connect attrs to slow query log (#22547) Jun 12, 2026
@lilin90 lilin90 assigned lilin90 and unassigned hfxsd Jun 12, 2026
github-actions Bot pushed a commit to lilin90/pingcap-docsite-preview that referenced this pull request Jun 12, 2026
@qiancai qiancai changed the base branch from release-8.5 to feature/preview-v8.5.7 June 30, 2026 01:38
@lilin90

lilin90 commented Jun 30, 2026

Copy link
Copy Markdown
Member

/approve

@ti-chi-bot

ti-chi-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lilin90

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 approved label Jun 30, 2026
@lilin90 lilin90 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 30, 2026
@ti-chi-bot ti-chi-bot Bot merged commit 68bb5e6 into pingcap:feature/preview-v8.5.7 Jun 30, 2026
12 checks passed
@ti-chi-bot ti-chi-bot Bot deleted the cherry-pick-22547-to-release-8.5 branch June 30, 2026 07:56
@ti-chi-bot

Copy link
Copy Markdown
Member Author

In response to a cherrypick label: new pull request created to branch master: #23172.
But this PR has conflicts, please resolve them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. lgtm needs-cherry-pick-master Should cherry pick this PR to master branch. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants