Skip to content

Conversation

@0xPoe
Copy link
Member

@0xPoe 0xPoe commented Jul 28, 2025

What problem does this PR solve?

Issue Number: close None

Problem Summary:

What changed and how does it work?

Mark TiDBEnableAutoAnalyzePriorityQueue as deprecated.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

将 tidb_enable_auto_analyze_priority_queue 标记为弃用,总是使用优先级队列来调度 auto-analyze
Mark tidb_enable_auto_analyze_priority_queue as deprecated, always use priority queue for auto-analyze scheduling

@0xPoe 0xPoe added the skip-issue-check Indicates that a PR no need to check linked issue. label Jul 28, 2025
@ti-chi-bot ti-chi-bot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 28, 2025
@0xPoe 0xPoe requested a review from Copilot July 28, 2025 09:21
@ti-chi-bot ti-chi-bot bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 28, 2025

This comment was marked as outdated.

@0xPoe 0xPoe requested a review from Copilot July 28, 2025 09:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR marks the tidb_enable_auto_analyze_priority_queue system variable as deprecated, enforcing that TiDB will always use a priority queue for auto-analyze scheduling.

  • Changes the validation logic to reject attempts to disable the setting
  • Adds deprecation comments to the variable definition
  • Improves code formatting in the system variable definition

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/sessionctx/variable/sysvar.go Updates validation logic to enforce priority queue usage and improves formatting
pkg/sessionctx/vardef/tidb_vars.go Adds deprecation comment to the variable definition
Comments suppressed due to low confidence (1)

pkg/sessionctx/variable/sysvar.go:1117

  • [nitpick] The error message should be more consistent with typical deprecation patterns. Consider using 'Setting X to OFF is no longer supported' format for clarity.
				return "", errors.New("tidb_enable_auto_analyze_priority_queue has been deprecated and TiDB will always use priority queue to schedule auto analyze.")

@ti-chi-bot ti-chi-bot bot added the sig/planner SIG: Planner label Jul 28, 2025
@codecov
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.3460%. Comparing base (f13696c) to head (4842702).
⚠️ Report is 36 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #62659        +/-   ##
================================================
+ Coverage   72.8568%   74.3460%   +1.4892%     
================================================
  Files          1776       1822        +46     
  Lines        486675     507489     +20814     
================================================
+ Hits         354576     377298     +22722     
+ Misses       110465     107798      -2667     
- Partials      21634      22393       +759     
Flag Coverage Δ
integration 46.2921% <0.0000%> (?)
unit 73.1550% <100.0000%> (+0.9761%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 46.3302% <ø> (-0.0054%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@0xPoe
Copy link
Member Author

0xPoe commented Jul 30, 2025

/test all

0xPoe added 5 commits August 1, 2025 20:55
…PriorityQueue

Updated the validation function to correctly check for the deprecated setting, ensuring it returns an error when the option is not enabled.

Signed-off-by: 0xPoe <[email protected]>
…_queue setting

Enhanced the test for enabling the auto analyze priority queue to check for errors when the setting is set to OFF, confirming the deprecation message is returned as expected.

Signed-off-by: 0xPoe <[email protected]>
…_queue

Removed the trailing period from the deprecation error message in both the validation function and the corresponding test case to ensure consistency in error reporting.

Signed-off-by: 0xPoe <[email protected]>
@0xPoe 0xPoe force-pushed the poe-patch-sysvar branch from a9e57a3 to 4842702 Compare August 1, 2025 18:55
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 1, 2025

@0xPoe: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
non-block-pull-unit-test-next-gen 77dcc75 link false /test pull-unit-test-next-gen
non-block/pull-unit-test-next-gen 4842702 link false /test pull-unit-test-next-gen
non-block/pull-mysql-client-test-next-gen 4842702 link false /test pull-mysql-client-test-next-gen
non-block/pull-mysql-test-next-gen 4842702 link false /test pull-mysql-test-next-gen
non-block/pull-integration-e2e-test-next-gen 4842702 link false /test pull-integration-e2e-test-next-gen

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Copy link
Member Author

@0xPoe 0xPoe left a comment

Choose a reason for hiding this comment

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

🔢 Self-check (PR reviewed by myself and ready for feedback)

  • Code compiles successfully

  • Unit tests added

  • All tests pass

  • Bazel files updated

  • Comments added where necessary

  • PR title and description updated

  • Documentation PR created (pingcap/docs#21526)

  • PR size is reasonable

/cc @terry1purcell @time-and-fate

Copy link
Contributor

@terry1purcell terry1purcell 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-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 6, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 6, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 6, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-08-06 13:54:23.823459795 +0000 UTC m=+449173.966220990: ☑️ agreed by terry1purcell.
  • 2025-08-06 14:00:40.092367206 +0000 UTC m=+449550.235128381: ☑️ agreed by time-and-fate.

Copy link

@yudongusa yudongusa left a comment

Choose a reason for hiding this comment

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

Please also open a document PR.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: terry1purcell, time-and-fate, yudongusa

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

The pull request process is described 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 approved label Aug 6, 2025
@ti-chi-bot ti-chi-bot bot merged commit 5f051c7 into pingcap:master Aug 6, 2025
27 of 31 checks passed
@0xPoe 0xPoe deleted the poe-patch-sysvar branch August 6, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files. skip-issue-check Indicates that a PR no need to check linked issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants