Skip to content

sys-var: clarify tidb_slow_log_rules syntax/behavior and de-duplicate slow log docs (#21337)#21478

Open
ti-chi-bot wants to merge 3 commits intopingcap:feature/preview-v8.5.6from
ti-chi-bot:cherry-pick-21337-to-release-8.5
Open

sys-var: clarify tidb_slow_log_rules syntax/behavior and de-duplicate slow log docs (#21337)#21478
ti-chi-bot wants to merge 3 commits intopingcap:feature/preview-v8.5.6from
ti-chi-bot:cherry-pick-21337-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #21337

What is changed, added or deleted? (Required)

This PR refactors and clarifies tidb_slow_log_rules documentation in:

  • system-variables.md
  • identify-slow-queries.md

Main updates:

  1. Reorganized tidb_slow_log_rules in system-variables.md with clearer structure:

    • Unified syntax and constraints
    • Type constraints
    • Full field table (type/unit/summary)
    • Effective behavior and matching order
    • Examples and usage recommendations
  2. Clarified key behavior/constraints:

    • SESSION/GLOBAL rule capacity and separators
    • SESSION does not support Conn_ID (GLOBAL only)
    • Matching semantics (>= for numeric, = for string/bool)
    • Rule update behavior (SET overwrites, not appends)
    • Fallback to tidb_slow_log_threshold when no effective rules
    • String values cannot contain , / ; (quoted values still not supported)
    • Repeated fields in one rule: last value wins
    • Time-unit distinction (tidb_slow_log_rules time fields are seconds, threshold is milliseconds)
  3. Reduced duplication between docs:

    • Kept rule contract/details in system-variables.md
    • Added metric interpretation section in identify-slow-queries.md
    • Replaced repeated long explanations with cross-references

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. lgtm size/L Denotes a PR that changes 100-499 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 Mar 30, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 30, 2026

[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 breezewish for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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
Copy link
Copy Markdown
Member Author

@zimulala 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
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 30, 2026

@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.

@hfxsd hfxsd removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 30, 2026
@hfxsd hfxsd assigned hfxsd and unassigned zimulala Mar 31, 2026
@hfxsd hfxsd changed the base branch from release-8.5 to feature/preview-v8.5.6 April 1, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm size/L Denotes a PR that changes 100-499 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.

3 participants