Skip to content

Reset current_memory_tracker when WNEstablishDisaggTaskHandler finished. (#8174)#8175

Merged
ti-chi-bot[bot] merged 2 commits intopingcap:release-7.4from
ti-chi-bot:cherry-pick-8174-to-release-7.4
Oct 10, 2023
Merged

Reset current_memory_tracker when WNEstablishDisaggTaskHandler finished. (#8174)#8175
ti-chi-bot[bot] merged 2 commits intopingcap:release-7.4from
ti-chi-bot:cherry-pick-8174-to-release-7.4

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #8174

What problem does this PR solve?

Issue Number: close #8173

Problem Summary:

  1. In WNEstablishDisaggTaskHandler::execute, a ProcessListElement object will be created and sets current_memory_tracker to its memory_tracker member in constructor. And current_memory_tracker will be reset in the destructor of ProcessListElement.

  2. However, objects of ProcessListElement are created in threads of WNEstablishDisaggTaskPool, but destructed in threads of GRPC because it will be destructed with object of WNEstablishDisaggTaskHandler (handler -> dag_context -> process_list_entry).

  3. This result in current_memory_tracker of threads of WNEstablishDisaggTaskPool is not reset after task finished and other tasks may continue to use this memory tracker, although it may have already been destructed.

What is changed and how it works?

  • Reset current_memory_tracker after tasks of WNEstablishDisaggTaskPool finished.

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

@ti-chi-bot ti-chi-bot bot added do-not-merge/cherry-pick-not-approved release-note-none Denotes a PR that doesn't merit a release note. labels Oct 10, 2023
@ti-chi-bot ti-chi-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-7.4 labels Oct 10, 2023
@JaySon-Huang
Copy link
Copy Markdown
Contributor

/run-all-tests

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Oct 10, 2023
Copy link
Copy Markdown
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 Oct 10, 2023
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Oct 10, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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,JinheLin]

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 Oct 10, 2023
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Oct 10, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-10 03:32:36.746773876 +0000 UTC m=+1109554.333884006: ☑️ agreed by JinheLin.
  • 2023-10-10 03:33:07.176811255 +0000 UTC m=+1109584.763921386: ☑️ agreed by JaySon-Huang.

@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Oct 10, 2023
@ti-chi-bot ti-chi-bot bot merged commit 58dba71 into pingcap:release-7.4 Oct 10, 2023
guo-shaoge pushed a commit to guo-shaoge/tiflash that referenced this pull request Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-7.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants