Skip to content

Conversation

@gengliqi
Copy link
Contributor

@gengliqi gengliqi commented Jul 18, 2025

What problem does this PR solve?

Issue Number: ref #10266

Problem Summary:

What is changed and how it works?

After #10299, TiFlash will wait for all MPPTasks to finish before shutdown.

Whether all MPP tasks have finished is determined by checking if monitored_tasks is empty. In MPPTask, MPPTaskMonitorHelper is the last member to be destructed, and only when it is destructed will removeMonitoredTask be called to remove the task id from monitored_tasks. MPPTunnels are stored in MPPTunnelSet, and although MPPTunnelSet is held by a shared_ptr, there are actually only two references: one directly in MPPTask, and the other inside the std::unique_ptr<DAGContext> also in MPPTask. Therefore, destroying the MPPTask will also destroy the MPPTunnel.

Remove unnecessary wait for MPP tunnel destruction during TiFlash shutdown

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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

None

gengliqi added 13 commits July 10, 2025 14:35
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 18, 2025
Copy link
Contributor

@windtalker windtalker 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 approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 18, 2025
@gengliqi
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 18, 2025
@gengliqi
Copy link
Contributor Author

/retest

u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@gengliqi gengliqi force-pushed the fix-graceful-shutdown branch from cbddc48 to 405f04a Compare July 21, 2025 14:16
gengliqi added 2 commits July 21, 2025 23:37
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
gengliqi added 2 commits July 22, 2025 12:34
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
gengliqi added 6 commits July 22, 2025 13:57
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Copy link
Contributor

@JaySon-Huang JaySon-Huang 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 lgtm label Jul 23, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, windtalker

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:
  • OWNERS [JaySon-Huang,windtalker]

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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 23, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 23, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-07-18 05:13:29.274063229 +0000 UTC m=+2840661.997242205: ☑️ agreed by windtalker.
  • 2025-07-23 06:18:39.23701199 +0000 UTC m=+145475.974438187: ☑️ agreed by JaySon-Huang.

@gengliqi
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2025
@ti-chi-bot ti-chi-bot bot merged commit 86c363c into pingcap:master Jul 23, 2025
7 checks passed
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Aug 26, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Aug 26, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #10369.
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 lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants