Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Join auto spill #7942

Merged
merged 16 commits into from Aug 25, 2023
Merged

Support Join auto spill #7942

merged 16 commits into from Aug 25, 2023

Conversation

windtalker
Copy link
Contributor

@windtalker windtalker commented Aug 15, 2023

What problem does this PR solve?

Issue Number: ref #7738

Problem Summary:

What is changed and how it works?

  • Refine OperatorSpillContext, before this pr, OperatorSpillContext::isSpillEnabled() will return true for the operator that support auto spill, even if auto spill itself is not enabled, after this pr, OperatorSpillContext::isSpillEnabled() will return true only if auto spill is enabled, and current operator support auto spill or auto spill is disabled, but current operator has operator_spill_threshold > 0
  • Support hash join auto spill under query level memory threshold.
  • Add some debug log for auto spill

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/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 15, 2023
@windtalker windtalker force-pushed the join_auto_spill branch 2 times, most recently from 9d4feeb to a4fa4ec Compare August 22, 2023 10:11
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 22, 2023
@windtalker windtalker changed the title WIP: Join auto spill Support Join auto spill Aug 23, 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 Aug 23, 2023
@SeaRise SeaRise self-requested a review August 23, 2023 10:42
dbms/src/Core/OperatorSpillContext.h Outdated Show resolved Hide resolved
dbms/src/Interpreters/HashJoinSpillContext.cpp Outdated Show resolved Hide resolved
@SeaRise SeaRise self-requested a review August 24, 2023 09:38
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 25, 2023
RUNTIME_CHECK_MSG(operator_spill_threshold == 0, "The operator spill threshold should be 0 in auto spill mode");
auto total_revocable_memory = getTotalRevocableMemory();
if (total_revocable_memory >= MIN_SPILL_THRESHOLD)
for (size_t i = 0; i < per_thread_revocable_memories.size() && expected_released_memories > 0; i++)
Copy link
Contributor

Choose a reason for hiding this comment

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

++i, :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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.

LGTM

@SeaRise
Copy link
Contributor

SeaRise commented Aug 25, 2023

/LGTM

@ti-chi-bot ti-chi-bot bot added the lgtm label Aug 25, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 25, 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

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
Copy link
Contributor

ti-chi-bot bot commented Aug 25, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-25 09:29:42.72159317 +0000 UTC m=+1487347.270609143: ☑️ agreed by yibin87.
  • 2023-08-25 09:48:57.080288325 +0000 UTC m=+1488501.629304312: ☑️ agreed by SeaRise.

@windtalker
Copy link
Contributor Author

/run-unit-test

windtalker and others added 15 commits August 25, 2023 21:07
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>
Signed-off-by: xufei <xufei@pingcap.com>
@windtalker
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 25, 2023

@windtalker: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

trigger some heavy tests which will not run always when PR updated.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-chi-bot bot merged commit 3fec901 into pingcap:master Aug 25, 2023
6 checks passed
@windtalker windtalker deleted the join_auto_spill branch September 20, 2023 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants