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

[Enhancement] adjust the BE and CN schedule policy (backport #44499) #45682

Merged
merged 3 commits into from
May 20, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 15, 2024

Why I'm doing:
In shared nothing mode,when deploy both BE and CN, and set prefer_compute_node=true, current BE and CN schedule policy is not very feel perfect:

  1. when query internal table, except scan fragment allocate to BE, other calculate fragment would allocate to CN.
  2. when query external table, all fragment would allocate to CN.

In some scenarios, like when sudden business peak, need temporarily add CN to increase computational resources, current BE and CN schedule policy would cause BE nodes have low resource usage ratio,CN nodes have high resource usage ratio,especially when business type belongs to computational tasks.

What I'm doing:
Add a new session variable computation_fragment_scheduling_policy, the value as follows:

  1. compute_nodes_only: the previous policy, as the default value.
  2. all_nodes:
    • when query internal table, scan fragment allocate to BE, other calculate fragment would allocate to both BE and CN。
    • when query external table, all fragment would allocate to both BE and CN。

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

This is an automatic backport of pull request #44499 done by [Mergify](https://mergify.com). Why I'm doing: In shared nothing mode,when deploy both BE and CN, and set `prefer_compute_node=true`, current BE and CN schedule policy is not very feel perfect: 1. when query internal table, except scan fragment allocate to BE, other calculate fragment would allocate to CN. 2. when query external table, all fragment would allocate to CN.

In some scenarios, like when sudden business peak, need temporarily add CN to increase computational resources, current BE and CN schedule policy would cause BE nodes have low resource usage ratio,CN nodes have high resource usage ratio,especially when business type belongs to computational tasks.

What I'm doing:
Add a new session variable computation_fragment_scheduling_policy, the value as follows:

  1. compute_nodes_only: the previous policy, as the default value.
  2. all_nodes:
    • when query internal table, scan fragment allocate to BE, other calculate fragment would allocate to both BE and CN。
    • when query external table, all fragment would allocate to both BE and CN。

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Signed-off-by: MatthewH00 <[email protected]>
Signed-off-by: hmx <[email protected]>
(cherry picked from commit ae7a4bf)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/lake/qe/scheduler/DefaultSharedDataWorkerProvider.java
#	fe/fe-core/src/main/java/com/starrocks/qe/CoordinatorPreprocessor.java
#	fe/fe-core/src/main/java/com/starrocks/qe/scheduler/DefaultWorkerProvider.java
#	fe/fe-core/src/main/java/com/starrocks/qe/scheduler/WorkerProvider.java
#	fe/fe-core/src/test/java/com/starrocks/lake/qe/scheduler/DefaultSharedDataWorkerProviderTest.java
#	fe/fe-core/src/test/java/com/starrocks/qe/scheduler/DefaultWorkerProviderTest.java
@mergify mergify bot added the conflicts label May 15, 2024
Copy link
Contributor Author

mergify bot commented May 15, 2024

Cherry-pick of ae7a4bf has failed:

On branch mergify/bp/branch-3.2/pr-44499
Your branch is up to date with 'origin/branch-3.2'.

You are currently cherry-picking commit ae7a4bfb73.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java
	modified:   fe/fe-core/src/main/java/com/starrocks/qe/SessionVariableConstants.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/analyzer/SetStmtAnalyzer.java
	modified:   fe/fe-core/src/test/java/com/starrocks/sql/analyzer/AnalyzeSetVariableTest.java

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/main/java/com/starrocks/lake/qe/scheduler/DefaultSharedDataWorkerProvider.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/qe/CoordinatorPreprocessor.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/qe/scheduler/DefaultWorkerProvider.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/qe/scheduler/WorkerProvider.java
	both modified:   fe/fe-core/src/test/java/com/starrocks/lake/qe/scheduler/DefaultSharedDataWorkerProviderTest.java
	both modified:   fe/fe-core/src/test/java/com/starrocks/qe/scheduler/DefaultWorkerProviderTest.java

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Copy link
Contributor Author

mergify bot commented May 15, 2024

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

@mergify mergify bot closed this May 15, 2024
auto-merge was automatically disabled May 15, 2024 10:59

Pull request was closed

@mergify mergify bot deleted the mergify/bp/branch-3.2/pr-44499 branch May 15, 2024 11:00
@kevincai kevincai restored the mergify/bp/branch-3.2/pr-44499 branch May 15, 2024 12:12
@kevincai kevincai reopened this May 15, 2024
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) May 15, 2024 12:12
@kevincai
Copy link
Contributor

@MatthewH00 can you help to solve the conflict for branch-3.2?

Base on this mergify/bp/branch-3.2/pr-44499 branch and submit a PR to this base branch to solve the conflict.

@MatthewH00
Copy link
Contributor

@MatthewH00 can you help to solve the conflict for branch-3.2?

Base on this mergify/bp/branch-3.2/pr-44499 branch and submit a PR to this base branch to solve the conflict.

OK,i will solve it later

@MatthewH00
Copy link
Contributor

@MatthewH00 can you help to solve the conflict for branch-3.2?

Base on this mergify/bp/branch-3.2/pr-44499 branch and submit a PR to this base branch to solve the conflict.

i have solved the conflict , please check it . the new pr is #45835

Copy link

sonarcloud bot commented May 19, 2024

@wanpengfei-git wanpengfei-git merged commit a206a44 into branch-3.2 May 20, 2024
28 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-3.2/pr-44499 branch May 20, 2024 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants