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 docs for TiFlash MinTso scheduler #19222

Merged
merged 14 commits into from
Nov 4, 2024
Merged

Conversation

windtalker
Copy link
Contributor

@windtalker windtalker commented Oct 28, 2024

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.

  • master (the latest development version)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.2 (TiDB 8.2 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)

What is the related PR or file 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

Signed-off-by: xufei <[email protected]>
@ti-chi-bot ti-chi-bot 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 Oct 28, 2024
@lilin90 lilin90 requested review from lilin90 and qiancai October 28, 2024 06:52
@lilin90 lilin90 added the translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. label Oct 28, 2024
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Oct 28, 2024
@lilin90 lilin90 self-assigned this Oct 28, 2024
@lilin90 lilin90 added ONCALL Relates to documentation oncall. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.2 needs-cherry-pick-release-8.3 Should cherry pick this PR to release-8.3 branch. needs-cherry-pick-release-8.4 Should cherry pick this PR to release-8.4 branch. labels Oct 28, 2024
Signed-off-by: xufei <[email protected]>
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
@lilin90 lilin90 requested a review from joey-yez November 4, 2024 02:31
Copy link

ti-chi-bot bot commented Nov 4, 2024

@joey-yez: adding LGTM is restricted to approvers and reviewers in OWNERS files.

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 kubernetes/test-infra repository.

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.

Rest LGTM

tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved
tiflash/tiflash-mintso-scheduler.md Outdated Show resolved Hide resolved

![TiFlash MinTSO Scheduler v2](/media/tiflash/tiflash_mintso_v2.png)

By introducing soft limit and hard limit, the MinTSO scheduler effectively avoids system deadlock while controlling the number of system threads. However, in high concurrency scenarios, it is possible that most queries will have only part of their MPP tasks scheduled. Queries with only part MPP tasks scheduled cannot execute normally, leading to low system execution efficiency. To avoid this situation, TiFlash introduces a limit at the query level for the MinTSO scheduler, called active_set_soft_limit. This limit requires that only up to active_set_soft_limit queries' MPP tasks can participate in scheduling; other queries' MPP Tasks do not participate in scheduling, and only after the current queries finish can new queries participate in scheduling. This limit is only a soft limit because for the MinTSO query, all its MPP tasks can be scheduled directly as long as the number of system threads does not exceed the hard limit.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
By introducing soft limit and hard limit, the MinTSO scheduler effectively avoids system deadlock while controlling the number of system threads. However, in high concurrency scenarios, it is possible that most queries will have only part of their MPP tasks scheduled. Queries with only part MPP tasks scheduled cannot execute normally, leading to low system execution efficiency. To avoid this situation, TiFlash introduces a limit at the query level for the MinTSO scheduler, called active_set_soft_limit. This limit requires that only up to active_set_soft_limit queries' MPP tasks can participate in scheduling; other queries' MPP Tasks do not participate in scheduling, and only after the current queries finish can new queries participate in scheduling. This limit is only a soft limit because for the MinTSO query, all its MPP tasks can be scheduled directly as long as the number of system threads does not exceed the hard limit.
By introducing soft limit and hard limit, the MinTSO scheduler effectively avoids system deadlock while controlling the number of system threads. In high concurrency scenarios, however, most queries might only have part of their MPP tasks scheduled. Queries with only part of MPP tasks scheduled cannot execute normally, leading to low system execution efficiency. To avoid this situation, TiFlash introduces a query-level limit for the MinTSO scheduler, called active_set_soft_limit. This limit allows only MPP tasks of up to active_set_soft_limit queries to participate in scheduling; MPP tasks of other queries do not participate in scheduling, and only after the current queries finish can new queries participate in scheduling. This limit is only a soft limit because for the MinTSO query, all its MPP tasks can be scheduled directly as long as the number of system threads does not exceed the hard limit.

@lilin90
Copy link
Member

lilin90 commented Nov 4, 2024

/approve

Copy link

ti-chi-bot bot commented Nov 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lilin90

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 ti-chi-bot bot added the approved label Nov 4, 2024
@ti-chi-bot ti-chi-bot bot merged commit 5a87506 into pingcap:master Nov 4, 2024
9 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.3: #19315.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.4: #19316.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #19317.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #19318.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #19319.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #19320.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #19321.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.2: #19322.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.3 Should cherry pick this PR to release-8.3 branch. needs-cherry-pick-release-8.4 Should cherry pick this PR to release-8.4 branch. ONCALL Relates to documentation oncall. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants