-
Notifications
You must be signed in to change notification settings - Fork 2k
[Enhancement] Add more informations for information_schema.task_runs #60054
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
base: main
Are you sure you want to change the base?
Conversation
// process finish time | ||
addField(resultRow, TimeUtils.longToTimeString(refreshJobStatus.getMvRefreshEndTime())); | ||
// process duration | ||
addField(resultRow, formatDuration(refreshJobStatus.getTotalProcessDuration())); | ||
// last refresh job id | ||
addField(resultRow, refreshJobStatus.getJobId()); | ||
// last refresh state | ||
addField(resultRow, refreshJobStatus.getRefreshState()); | ||
// whether it's force refresh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most risky bug in this code is:
Assigning mvRefreshStartTime
to mvRefreshProcessTime
, potentially causing misleading timestamps.
You can modify the code like this:
// start time
long mvRefreshCreateTime = firstTaskRunStatus.getCreateTime();
status.setMvRefreshStartTime(mvRefreshCreateTime);
// process time - assumed it should be a different timestamp, correcting that
long mvRefreshProcessTime = firstTaskRunStatus.getProcessStartTime();
status.setMvRefreshProcessTime(mvRefreshProcessTime);
Ensure that getCreateTime()
and getProcessStartTime()
return the expected timestamps for their respective usage.
fe/fe-core/src/main/java/com/starrocks/scheduler/persist/TaskRunStatus.java
Show resolved
Hide resolved
@LiShuMing, this will change user interface, please don't cherry-pick to v3.5 |
a643e7d
to
91006b8
Compare
91006b8
to
b4cef8d
Compare
34f1fdb
to
fdff3f7
Compare
|
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]❌ fail : 121 / 155 (78.06%) file detail
|
[BE Incremental Coverage Report]❌ fail : 1 / 22 (04.55%) file detail
|
Why I'm doing:
information_schema.task_runs
orinformation_schema.materialized_views
;job
(the mv refresh task).so I added more informations about those two situations.
What I'm doing:
This pull request introduces enhancements to the schema scanner and materialized views system, focusing on adding new fields, improving data type consistency, and refining the handling of materialized view refresh statuses. The changes span multiple files and primarily affect the backend schema scanner, frontend catalog system, and materialized view status representation.
Backend Schema Scanner Enhancements:
LAST_REFRESH_PROCESS_TIME
andLAST_REFRESH_JOB_ID
to theSchemaMaterializedViewsScanner
and updated thefill_chunk
method to include these fields. [1] [2]JOB_ID
,JOB_STATE
, andPROCESS_TIME
to theSchemaTaskRunsScanner
, with corresponding updates to thefill_chunk
method to handle these fields. [1] [2]Frontend Catalog System Updates:
MaterializedViewsSystemTable
to include new columns (LAST_REFRESH_PROCESS_TIME
,LAST_REFRESH_JOB_ID
, etc.) and changed data types for several existing columns (e.g.,MATERIALIZED_VIEW_ID
toBIGINT
,LAST_REFRESH_DURATION
toDOUBLE
). [1] [2]TaskRunsSystemTable
by addingJOB_ID
,JOB_STATE
, andPROCESS_TIME
columns, along with corresponding data type adjustments. [1] [2]Materialized View Status Improvements:
jobId
andmvRefreshProcessTime
toShowMaterializedViewStatus
to track job-specific and process-related information. [1] [2] [3]ShowMaterializedViewStatus
to populate and display the new fields (jobId
,mvRefreshProcessTime
) in both thrift and result set representations. [1] [2] [3]Data Type Consistency:
ShowMaterializedViewsStmt
andMaterializedViewsSystemTable
, converting several fields (e.g.,id
,task_id
,rows
) toBIGINT
and others (e.g.,last_refresh_duration
) to more appropriate types likeDOUBLE
orDATETIME
. [1] [2]TaskRun Status Refinement:
TaskRunStatus
to better handle refresh states for materialized views, including distinguishing between running and finished states. [1] [2]Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: