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

Add information of hashAgg for memory control #6819

Merged
merged 25 commits into from
Aug 13, 2021
Merged

Conversation

wshwsh12
Copy link
Contributor

@wshwsh12 wshwsh12 commented Aug 6, 2021

First-time contributors' checklist

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 6, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • qiancai

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 6, 2021
@wshwsh12 wshwsh12 added the v5.2 This PR/issue applies to TiDB v5.2. label Aug 6, 2021
@wshwsh12
Copy link
Contributor Author

wshwsh12 commented Aug 6, 2021

/cc @XuHuaiyu

@TomShawn
Copy link
Contributor

TomShawn commented Aug 6, 2021

/rebase

@TomShawn TomShawn added translation/doing This PR’s assignee is translating this PR. and removed missing-translation-status This PR does not have translation status info. labels Aug 6, 2021
configure-memory-usage.md Outdated Show resolved Hide resolved
@TomShawn TomShawn added the status/PTAL This PR is ready for reviewing. label Aug 9, 2021
configure-memory-usage.md Outdated Show resolved Hide resolved
Copy link
Contributor

@Liuxiaozhen12 Liuxiaozhen12 left a comment

Choose a reason for hiding this comment

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

not sure the form of command I suggested is correct or not. Just suggestions.

configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved
@TomShawn TomShawn added status/require-change Needs the author to address comments. and removed status/PTAL This PR is ready for reviewing. labels Aug 10, 2021
Copy link
Collaborator

@qiancai qiancai left a comment

Choose a reason for hiding this comment

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

@wshwsh12 PTAL

configure-memory-usage.md Outdated Show resolved Hide resolved
- 落盘行为会由参数 [`mem-quota-query`](/tidb-configuration-file.md#mem-quota-query),[`oom-use-tmp-storage`](/tidb-configuration-file.md#oom-use-tmp-storage),[`oom-use-tmp-storage`](/tidb-configuration-file.md#oom-use-tmp-storage), [`tmp-storage-path`](/tidb-configuration-file.md#tmp-storage-path),[`tmp-storage-quota`](/tidb-configuration-file.md#tmp-storage-quota) 共同控制。
- 当落盘被触发时,会在日志中打印一条包含关键字 `memory exceeds quota, spill to disk now` 或 `memory exceeds quota, set aggregate mode to spill-mode` 的日志。
- Sort,MergeJoin,HashJoin 落盘是从 v4.0.0 版本开始引入的,HashAgg 落盘是从 v5.2.0 版本开始引入的。
- 含 HashAgg 的 SQL 引起 OOM 时,可以尝试设置 concurrency = 1 来触发落盘。
Copy link
Collaborator

Choose a reason for hiding this comment

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

对于除 HashAgg 外的其他算子,是不是不支持手动设置参数触发落盘呢?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

其他算子落盘是默认开启。 可以通过 oom-use-tmp-storage 来控制所有的落盘行为。

@TomShawn TomShawn removed the status/require-change Needs the author to address comments. label Aug 10, 2021
configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved
configure-memory-usage.md Show resolved Hide resolved
configure-memory-usage.md Outdated Show resolved Hide resolved

## tidb-server 其它内存控制策略

### 流控
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里要不要写成 “动态内存控制功能“

Copy link
Contributor Author

Choose a reason for hiding this comment

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

写成”流量控制“ 可以吗? ”动态内存控制功能“太宽泛,数据落盘也能算动态内存控制功能

configure-memory-usage.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@qiancai qiancai 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 added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 13, 2021
Copy link
Contributor

@XuHuaiyu XuHuaiyu 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
Copy link
Member

@XuHuaiyu: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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.

@TomShawn
Copy link
Contributor

/remove-status LGT1
/status LGT2

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 13, 2021
@TomShawn
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: d557021

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 13, 2021
@ti-chi-bot ti-chi-bot merged commit 863371c into pingcap:master Aug 13, 2021
@Liuxiaozhen12 Liuxiaozhen12 added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR’s assignee is translating this PR. labels Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/PTAL This PR is ready for reviewing. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. v5.2 This PR/issue applies to TiDB v5.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants