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

[Feature] Unify load profile through analyze profile & support session/table profile collect granularity (backport #47548) #51892

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 14, 2024

Why I'm doing:

  • support table granularity for profile collect
  • support profile collect when stream/routine load failure
  • unify profile analyze interface

What I'm doing:

mysql> create table t(k int, v int);
Query OK, 0 rows affected (0.11 sec)

mysql> alter table t set('enable_load_profile'='true');
Query OK, 0 rows affected (0.02 sec)

mysql> analyze profile from '1a462e3a-dcc7-94f4-e7ad-d272b485439f';
+-----------------------------------------------------------+
| Explain String                                            |
+-----------------------------------------------------------+
| Load:                                                     |
|   Summary:                                                |
|      - Query ID: 1a462e3a-dcc7-94f4-e7ad-d272b485439f     |
|      - Start Time: 2024-06-27 01:14:35                    |
|      - End Time: 2024-06-27 01:14:47                      |
|      - Query Type: Load                                   |
|      - Load Type: STREAM_LOAD                             |
|      - Query State: Finished                              |
|      - StarRocks Version: unify_load_profile-a79910b      |
|      - Sql Statement                                      |
|      - Default Db: d                                      |
|      - Total: 11s515ms                                    |
|   Execution:                                              |
|     Fragment 0:                                           |
|        - Address: 172.26.95.141:51686                     |
|        - InstanceId: 1a462e3a-dcc7-94f4-e7ad-d272b48543a0 |
|        - TxnID: 8009                                      |
|        - ReplicatedStorage: true                          |
|        - AutomaticPartition: false                        |
|        - AutomaticBucketSize: 4294967296                  |
|        - InstanceAllocatedMemoryUsage: 1.370 GB           |
|        - InstanceDeallocatedMemoryUsage: 860.124 MB       |
|        - InstancePeakMemoryUsage: 15.092 MB               |
|        - MemoryLimit: -1.000 B                            |
|        - RowsProduced: 55.325M (55324672)                 |
|          - AllocAutoIncrementTime: 1.286ms                |
|          - BytesRead: 0.000 B                             |
|          - CloseWaitTime: 0ns                             |
|          - IOTaskExecTime: 0ns                            |
|          - IOTaskWaitTime: 0ns                            |
|          - IndexNum: 1                                    |
|          - NumDiskAccess: 0                               |
|          - OpenTime: 2.942ms                              |
|          - PeakMemoryUsage: 0.000 B                       |
|          - PrepareDataTime: 1s386ms                       |
|            - ConvertChunkTime: 0ns                        |
|            - ValidateDataTime: 0ns                        |
|          - RowsFiltered: 0                                |
|          - RowsRead: 0                                    |
|          - RowsReturned: 55.325M (55324672)               |
|          - RowsReturnedRate: 69.136M (69135610) /sec      |
|          - RpcClientSideTime: 9s521ms                     |
|          - RpcServerSideTime: 0ns                         |
|          - RpcServerWaitFlushTime: 0ns                    |
|          - ScanTime: 8s815ms                              |
|          - ScannerQueueCounter: 199                       |
|          - ScannerQueueTime: 11s126ms                     |
|          - ScannerThreadsInvoluntaryContextSwitches: 0    |
|          - ScannerThreadsTotalWallClockTime: 0ns          |
|            - MaterializeTupleTime(*): 0ns                 |
|            - ScannerThreadsSysTime: 0ns                   |
|            - ScannerThreadsUserTime: 0ns                  |
|          - ScannerThreadsVoluntaryContextSwitches: 0      |
|          - SendDataTime: 8s728ms                          |
|            - PackChunkTime: 1s634ms                       |
|            - SendRpcTime: 0ns                             |
|              - CompressTime: 0ns                          |
|              - SerializeChunkTime: 0ns                    |
|            - WaitResponseTime: 2s238ms                    |
|          - TotalRawReadTime(*): 0ns                       |
|          - TotalReadThroughput: 0.000 B/sec               |
|       DataSource:                                         |
|          - DataSourceType: FileDataSource                 |
|          - FileScanner:                                   |
|            - CastChunkTime: 0ns                           |
|            - CreateChunkTime: 0ns                         |
|            - FileReadCount: 0                             |
|            - FileReadTime: 0ns                            |
|            - FillTime: 0ns                                |
|            - MaterializeTime: 0ns                         |
|            - ReadTime: 0ns                                |
|          - ScannerTotalTime: 0ns                          |
+-----------------------------------------------------------+
72 rows in set (0.02 sec)

Fixes #47069

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 #47548 done by [Mergify](https://mergify.com). ## Why I'm doing: * support table granularity for profile collect * support profile collect when stream/routine load failure * unify profile analyze interface

What I'm doing:

mysql> create table t(k int, v int);
Query OK, 0 rows affected (0.11 sec)

mysql> alter table t set('enable_load_profile'='true');
Query OK, 0 rows affected (0.02 sec)

mysql> analyze profile from '1a462e3a-dcc7-94f4-e7ad-d272b485439f';
+-----------------------------------------------------------+
| Explain String                                            |
+-----------------------------------------------------------+
| Load:                                                     |
|   Summary:                                                |
|      - Query ID: 1a462e3a-dcc7-94f4-e7ad-d272b485439f     |
|      - Start Time: 2024-06-27 01:14:35                    |
|      - End Time: 2024-06-27 01:14:47                      |
|      - Query Type: Load                                   |
|      - Load Type: STREAM_LOAD                             |
|      - Query State: Finished                              |
|      - StarRocks Version: unify_load_profile-a79910b      |
|      - Sql Statement                                      |
|      - Default Db: d                                      |
|      - Total: 11s515ms                                    |
|   Execution:                                              |
|     Fragment 0:                                           |
|        - Address: 172.26.95.141:51686                     |
|        - InstanceId: 1a462e3a-dcc7-94f4-e7ad-d272b48543a0 |
|        - TxnID: 8009                                      |
|        - ReplicatedStorage: true                          |
|        - AutomaticPartition: false                        |
|        - AutomaticBucketSize: 4294967296                  |
|        - InstanceAllocatedMemoryUsage: 1.370 GB           |
|        - InstanceDeallocatedMemoryUsage: 860.124 MB       |
|        - InstancePeakMemoryUsage: 15.092 MB               |
|        - MemoryLimit: -1.000 B                            |
|        - RowsProduced: 55.325M (55324672)                 |
|          - AllocAutoIncrementTime: 1.286ms                |
|          - BytesRead: 0.000 B                             |
|          - CloseWaitTime: 0ns                             |
|          - IOTaskExecTime: 0ns                            |
|          - IOTaskWaitTime: 0ns                            |
|          - IndexNum: 1                                    |
|          - NumDiskAccess: 0                               |
|          - OpenTime: 2.942ms                              |
|          - PeakMemoryUsage: 0.000 B                       |
|          - PrepareDataTime: 1s386ms                       |
|            - ConvertChunkTime: 0ns                        |
|            - ValidateDataTime: 0ns                        |
|          - RowsFiltered: 0                                |
|          - RowsRead: 0                                    |
|          - RowsReturned: 55.325M (55324672)               |
|          - RowsReturnedRate: 69.136M (69135610) /sec      |
|          - RpcClientSideTime: 9s521ms                     |
|          - RpcServerSideTime: 0ns                         |
|          - RpcServerWaitFlushTime: 0ns                    |
|          - ScanTime: 8s815ms                              |
|          - ScannerQueueCounter: 199                       |
|          - ScannerQueueTime: 11s126ms                     |
|          - ScannerThreadsInvoluntaryContextSwitches: 0    |
|          - ScannerThreadsTotalWallClockTime: 0ns          |
|            - MaterializeTupleTime(*): 0ns                 |
|            - ScannerThreadsSysTime: 0ns                   |
|            - ScannerThreadsUserTime: 0ns                  |
|          - ScannerThreadsVoluntaryContextSwitches: 0      |
|          - SendDataTime: 8s728ms                          |
|            - PackChunkTime: 1s634ms                       |
|            - SendRpcTime: 0ns                             |
|              - CompressTime: 0ns                          |
|              - SerializeChunkTime: 0ns                    |
|            - WaitResponseTime: 2s238ms                    |
|          - TotalRawReadTime(*): 0ns                       |
|          - TotalReadThroughput: 0.000 B/sec               |
|       DataSource:                                         |
|          - DataSourceType: FileDataSource                 |
|          - FileScanner:                                   |
|            - CastChunkTime: 0ns                           |
|            - CreateChunkTime: 0ns                         |
|            - FileReadCount: 0                             |
|            - FileReadTime: 0ns                            |
|            - FillTime: 0ns                                |
|            - MaterializeTime: 0ns                         |
|            - ReadTime: 0ns                                |
|          - ScannerTotalTime: 0ns                          |
+-----------------------------------------------------------+
72 rows in set (0.02 sec)

Fixes #47069

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

…n/table profile collect granularity (#47548)

Signed-off-by: meegoo <[email protected]>
(cherry picked from commit 2a31794)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/catalog/TableProperty.java
@mergify mergify bot added the conflicts label Oct 14, 2024
Copy link
Contributor Author

mergify bot commented Oct 14, 2024

Cherry-pick of 2a31794 has failed:

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

You are currently cherry-picking commit 2a31794679.
  (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:   docs/en/administration/management/FE_configuration.md
	modified:   docs/zh/administration/management/FE_configuration.md
	modified:   fe/fe-core/src/main/java/com/starrocks/alter/AlterJobExecutor.java
	modified:   fe/fe-core/src/main/java/com/starrocks/alter/SchemaChangeHandler.java
	modified:   fe/fe-core/src/main/java/com/starrocks/catalog/OlapTable.java
	modified:   fe/fe-core/src/main/java/com/starrocks/common/Config.java
	modified:   fe/fe-core/src/main/java/com/starrocks/common/util/ProfileManager.java
	modified:   fe/fe-core/src/main/java/com/starrocks/common/util/PropertyAnalyzer.java
	modified:   fe/fe-core/src/main/java/com/starrocks/journal/JournalEntity.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/loadv2/LoadJob.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/streamload/StreamLoadTask.java
	modified:   fe/fe-core/src/main/java/com/starrocks/persist/EditLog.java
	modified:   fe/fe-core/src/main/java/com/starrocks/persist/OperationType.java
	modified:   fe/fe-core/src/main/java/com/starrocks/planner/StreamLoadPlanner.java
	modified:   fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java
	modified:   fe/fe-core/src/main/java/com/starrocks/qe/scheduler/QueryRuntimeProfile.java
	modified:   fe/fe-core/src/main/java/com/starrocks/qe/scheduler/dag/FragmentInstanceExecState.java
	modified:   fe/fe-core/src/main/java/com/starrocks/server/LocalMetastore.java
	modified:   fe/fe-core/src/main/java/com/starrocks/server/OlapTableFactory.java
	modified:   fe/fe-core/src/main/java/com/starrocks/service/FrontendServiceImpl.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/ExplainAnalyzer.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AlterTableClauseAnalyzer.java
	modified:   fe/fe-core/src/test/java/com/starrocks/load/streamload/StreamLoadTaskTest.java
	modified:   fe/fe-core/src/test/java/com/starrocks/persist/OperationTypeTest.java
	modified:   gensrc/thrift/AgentService.thrift
	new file:   test/common/data/stream_load/kv.csv
	new file:   test/sql/test_load_profile/R/test_load_profile
	modified:   test/sql/test_load_profile/T/test_load_profile

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/main/java/com/starrocks/catalog/TableProperty.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

@github-actions github-actions bot added documentation Improvements or additions to documentation automerge labels Oct 14, 2024
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) October 14, 2024 17:10
@mergify mergify bot closed this Oct 14, 2024
auto-merge was automatically disabled October 14, 2024 17:10

Pull request was closed

Copy link
Contributor Author

mergify bot commented Oct 14, 2024

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

@meegoo meegoo reopened this Oct 14, 2024
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) October 14, 2024 17:16
@meegoo meegoo disabled auto-merge October 14, 2024 17:29
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) October 14, 2024 17:29
@meegoo meegoo disabled auto-merge October 14, 2024 20:04
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) October 14, 2024 20:31
Copy link

sonarcloud bot commented Oct 14, 2024

@meegoo meegoo disabled auto-merge October 14, 2024 21:05
@meegoo meegoo enabled auto-merge (squash) October 14, 2024 21:06
@meegoo meegoo merged commit 88aa15f into branch-3.3 Oct 14, 2024
28 of 29 checks passed
@meegoo meegoo deleted the mergify/bp/branch-3.3/pr-47548 branch October 14, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge conflicts documentation Improvements or additions to documentation version:3.3.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant