tidb icon indicating copy to clipboard operation
tidb copied to clipboard

stats: close the priority queue DDL handler when auto-analyze is disabled (#64817)

Open ti-chi-bot opened this issue 2 weeks ago • 8 comments

This is an automated cherry-pick of #64817

What problem does this PR solve?

Issue Number: close https://github.com/pingcap/tidb/issues/64038

Problem Summary:

What changed and how does it work?

  1. If auto-analyze is disabled, we should close the priority queue and allow it to be re-enabled correctly later and also avoid to return retry later error here.
  2. I also ignored errors that occur during handling DDL events to prevent them from blocking the ddl_notifier from being cleaned.

Check List

Tests

  • [x] 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.

修复 auto-anlyze 关闭之后 mysql.tidb_ddl_notifier 不能被清理的问题
Fix the issue where mysql.tidb_ddl_notifier cannot be cleaned up after auto-analyze is turned off

ti-chi-bot avatar Dec 10 '25 19:12 ti-chi-bot

@0xPoe 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 avatar Dec 10 '25 19:12 ti-chi-bot

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

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[bot] avatar Dec 10 '25 19:12 ti-chi-bot[bot]

/unhold

0xPoe avatar Dec 10 '25 20:12 0xPoe

Codecov Report

:x: Patch coverage is 53.57143% with 13 lines in your changes missing coverage. Please review. :warning: Please upload report for BASE (release-8.5@7c29611). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.5     #64963   +/-   ##
================================================
  Coverage               ?   76.7362%           
================================================
  Files                  ?       1672           
  Lines                  ?     464315           
  Branches               ?          0           
================================================
  Hits                   ?     356298           
  Misses                 ?      86422           
  Partials               ?      21595           
Flag Coverage Δ
integration 50.0265% <39.2857%> (?)
unit 72.5917% <53.5714%> (?)

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

Components Coverage Δ
dumpling 52.9278% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 57.2146% <0.0000%> (?)
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 10 '25 20:12 codecov[bot]

/retest

0xPoe avatar Dec 10 '25 21:12 0xPoe

/retest

0xPoe avatar Dec 10 '25 21:12 0xPoe

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 0xPoe, terry1purcell

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[bot] avatar Dec 10 '25 22:12 ti-chi-bot[bot]

[LGTM Timeline notifier]

Timeline:

  • 2025-12-10 20:34:59.607285879 +0000 UTC m=+1073244.421063452: :ballot_box_with_check: agreed by 0xPoe.
  • 2025-12-10 22:36:37.386210258 +0000 UTC m=+1080542.199987820: :ballot_box_with_check: agreed by terry1purcell.

ti-chi-bot[bot] avatar Dec 10 '25 22:12 ti-chi-bot[bot]