-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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] Add cluster idle HTTP api (backport #53850) #54010
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cherry picked from commit 6cd9fbc) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/alter/LakeTableSchemaChangeJob.java # fe/fe-core/src/main/java/com/starrocks/alter/OnlineOptimizeJobV2.java # fe/fe-core/src/main/java/com/starrocks/alter/RollupJobV2.java # fe/fe-core/src/main/java/com/starrocks/alter/SchemaChangeJobV2.java # fe/fe-core/src/main/java/com/starrocks/backup/BackupJob.java # fe/fe-core/src/main/java/com/starrocks/backup/RestoreJob.java # fe/fe-core/src/main/java/com/starrocks/common/Config.java # fe/fe-core/src/main/java/com/starrocks/connector/metadata/MetadataExecutor.java # fe/fe-core/src/main/java/com/starrocks/datacache/DataCacheSelectExecutor.java # fe/fe-core/src/main/java/com/starrocks/load/routineload/RoutineLoadJob.java # fe/fe-core/src/main/java/com/starrocks/load/streamload/StreamLoadMgr.java # fe/fe-core/src/main/java/com/starrocks/load/streamload/StreamLoadTask.java # fe/fe-core/src/main/java/com/starrocks/qe/ConnectContext.java # fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java # fe/fe-core/src/main/java/com/starrocks/qe/feedback/PlanAdvisorExecutor.java # fe/fe-core/src/main/java/com/starrocks/server/GlobalStateMgr.java # fe/fe-core/src/main/java/com/starrocks/server/WarehouseManager.java # fe/fe-core/src/main/java/com/starrocks/sql/util/CustomizedQueryExecutor.java # fe/fe-core/src/main/java/com/starrocks/statistic/HyperStatisticsCollectJob.java # fe/fe-core/src/test/java/com/starrocks/scheduler/MVRefreshTestBase.java # fe/fe-core/src/test/java/com/starrocks/sql/optimizer/rule/transformation/materialization/MvRewriteTestBase.java
Cherry-pick of 6cd9fbc has failed:
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 |
24 tasks
@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I'm doing:
Add cluster idle api to help judge the cluster status.
What I'm doing:
Add a new daemon thread WarehouseIdleChecker to count all the tasks being executed and the time when the last task ended. If all the tasks being executed are 0 and the time when the last task ended has exceeded
Config.warehouse_idle_check_interval_seconds
, the system is considered idle.The entry point for all SQL execution in the system is StmtExecutor. If it is synchronous SQL, we only need to count the SQL executed in StmtExecutor. If it is asynchronous SQL, such as broker load, we also need to count these asynchronously executed tasks: Stream Load, Broker Load, Spark Load, Routine Load, Backup/Restore, Schema Change.
In addition, for SQL executed within the system, such as statistics collection, we do not need to count them. Add the
isInternal
field in StmtExecutor to determine whether the SQL is initiated internally or by the user.api request
/api/idle_status
api response
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist: