Skip to content

Introduce mpp query level processListEntry#7644

Merged
ti-chi-bot[bot] merged 13 commits intopingcap:masterfrom
windtalker:mpp_query_memory_tracker
Jun 16, 2023
Merged

Introduce mpp query level processListEntry#7644
ti-chi-bot[bot] merged 13 commits intopingcap:masterfrom
windtalker:mpp_query_memory_tracker

Conversation

@windtalker
Copy link
Contributor

@windtalker windtalker commented Jun 12, 2023

What problem does this PR solve?

Issue Number: close #7643

Problem Summary:

  • Introduce query level processListEntry for mpp query, so all the mpp tasks belong to the same mpp query will share the same processListEntry(and the same memory_tracker)
  • Remove switchMemTracker for local tunnel since the memory tracker is now the same in source mpp task and target mpp task.
  • Disable local tunnel in ut if sender task is the root task

What is changed and how it works?

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 release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 12, 2023
@windtalker windtalker changed the title Introduce query level memory_tracker for mpp query WIP: Introduce query level memory_tracker for mpp query Jun 12, 2023
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 12, 2023
@windtalker windtalker force-pushed the mpp_query_memory_tracker branch 3 times, most recently from dea695f to 4611394 Compare June 15, 2023 02:39
@windtalker windtalker changed the title WIP: Introduce query level memory_tracker for mpp query Introduce mpp query level processListEntry Jun 15, 2023
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 15, 2023
@windtalker
Copy link
Contributor Author

/run-all-tests

@SeaRise SeaRise mentioned this pull request Jun 15, 2023
12 tasks
@SeaRise SeaRise self-requested a review June 15, 2023 07:52
@windtalker
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@SeaRise SeaRise left a comment

Choose a reason for hiding this comment

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

Others LGTM

@windtalker windtalker force-pushed the mpp_query_memory_tracker branch from 916e3a7 to 1e93b23 Compare June 15, 2023 09:42
Copy link
Contributor

@SeaRise SeaRise 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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jun 15, 2023
@windtalker
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@yibin87 yibin87 left a comment

Choose a reason for hiding this comment

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

Others LGTM

private:
struct ProcessListEntryHolder
{
std::shared_ptr<ProcessListEntry> process_list_entry;
Copy link
Contributor

Choose a reason for hiding this comment

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

Might consider cache a raw pointer here to avoid get() overload? Just a suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is only used during compile time, so I think not very necessary to cache a raw pointer.

if (!abort_reason.empty())
return {nullptr, abort_reason};
if (query_set == nullptr)
query_set = addMPPQueryTaskSet(query_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

if (query_set == nullptr) /// the first one
, should this branch be removed? Since initProcessListEntry is done before registerTask

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are right, I've updated the code.

@ti-chi-bot ti-chi-bot bot added the lgtm label Jun 16, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SeaRise, yibin87

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:

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 Jun 16, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 16, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-06-15 09:56:30.346316833 +0000 UTC m=+252386.760920897: ☑️ agreed by SeaRise.
  • 2023-06-16 02:48:52.892622828 +0000 UTC m=+313129.307226907: ☑️ agreed by yibin87.

Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
@windtalker windtalker force-pushed the mpp_query_memory_tracker branch from 986d951 to 5846e92 Compare June 16, 2023 03:05
@windtalker
Copy link
Contributor Author

/run-all-tests

@windtalker
Copy link
Contributor Author

/run-integration-test

1 similar comment
@windtalker
Copy link
Contributor Author

/run-integration-test

@ti-chi-bot ti-chi-bot bot merged commit b9899e9 into pingcap:master Jun 16, 2023
windtalker added a commit to windtalker/tiflash that referenced this pull request Jun 21, 2023
@windtalker windtalker mentioned this pull request Jun 25, 2023
12 tasks
ti-chi-bot bot pushed a commit that referenced this pull request Jun 27, 2023
@windtalker windtalker deleted the mpp_query_memory_tracker branch September 20, 2023 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refine memory_tracker/process_list in TiFlash

3 participants