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 observation interface through information_schema.loads & _statistics_.loads_history (backport #46773) #50853

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 9, 2024

Why I'm doing:

mysql> select * from information_schema.loads where type = 'BROKER' order by scan_rows desc limit 1 \G;
*************************** 1. row ***************************
                  ID: 11002
               LABEL: lineorder_1720593471
          PROFILE_ID: NULL
             DB_NAME: ssb
          TABLE_NAME: lineorder
                USER: root
           WAREHOUSE: NULL
               STATE: FINISHED
            PROGRESS: ETL:100%; LOAD:100%
                TYPE: BROKER
            PRIORITY: NORMAL
           SCAN_ROWS: 6001215
          SCAN_BYTES: 598754908
       FILTERED_ROWS: 0
     UNSELECTED_ROWS: 0
           SINK_ROWS: 6001215
     RUNTIME_DETAILS: {"backends": {"cd6d9391-605a-4bc3-a3ca-dd95cdb96877": [10001, 10213, 10166]}, "file_size": 588311786, "load_id": "cd6d9391-605a-4bc3-a3ca-dd95cdb96877", "task_num": 1, "txn_id": 53, "unfinished_backends": {"cd6d9391-605a-4bc3-a3ca-dd95cdb96877": []}}
         CREATE_TIME: 2024-07-10 14:37:51
     LOAD_START_TIME: 2024-07-10 14:37:55
    LOAD_COMMIT_TIME: 2024-07-10 14:38:09
    LOAD_FINISH_TIME: 2024-07-10 14:38:09
          PROPERTIES: {"max_filter_ratio": 0, "timeout": 14400}
           ERROR_MSG: NULL
        TRACKING_SQL: NULL
REJECTED_RECORD_PATH: NULL
              JOB_ID: 11002
1 row in set (0.03 sec)


What I'm doing:

Fixes #46775

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 #46773 done by [Mergify](https://mergify.com). ## Why I'm doing: ``` mysql> select * from information_schema.loads where type = 'BROKER' order by scan_rows desc limit 1 \G; *************************** 1. row *************************** ID: 11002 LABEL: lineorder_1720593471 PROFILE_ID: NULL DB_NAME: ssb TABLE_NAME: lineorder USER: root WAREHOUSE: NULL STATE: FINISHED PROGRESS: ETL:100%; LOAD:100% TYPE: BROKER PRIORITY: NORMAL SCAN_ROWS: 6001215 SCAN_BYTES: 598754908 FILTERED_ROWS: 0 UNSELECTED_ROWS: 0 SINK_ROWS: 6001215 RUNTIME_DETAILS: {"backends": {"cd6d9391-605a-4bc3-a3ca-dd95cdb96877": [10001, 10213, 10166]}, "file_size": 588311786, "load_id": "cd6d9391-605a-4bc3-a3ca-dd95cdb96877", "task_num": 1, "txn_id": 53, "unfinished_backends": {"cd6d9391-605a-4bc3-a3ca-dd95cdb96877": []}} CREATE_TIME: 2024-07-10 14:37:51 LOAD_START_TIME: 2024-07-10 14:37:55 LOAD_COMMIT_TIME: 2024-07-10 14:38:09 LOAD_FINISH_TIME: 2024-07-10 14:38:09 PROPERTIES: {"max_filter_ratio": 0, "timeout": 14400} ERROR_MSG: NULL TRACKING_SQL: NULL REJECTED_RECORD_PATH: NULL JOB_ID: 11002 1 row in set (0.03 sec)

## What I'm doing:

Fixes #46775

## What type of PR is this:

- [ ] BugFix
- [x] Feature
- [ ] Enhancement
- [ ] Refactor
- [ ] UT
- [ ] Doc
- [ ] Tool

Does this PR entail a change in behavior?

- [ ] Yes, this PR will result in a change in behavior.
- [x] No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

- [x] 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:

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

….loads & _statistics_.loads_history (#46773)

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

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/http/rest/RestBaseAction.java
Copy link
Contributor Author

mergify bot commented Sep 9, 2024

Cherry-pick of cfe6031 has failed:

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

You are currently cherry-picking commit cfe6031ff0.
  (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:   be/src/exec/schema_scanner/schema_load_tracking_logs_scanner.cpp
	modified:   be/src/exec/schema_scanner/schema_loads_scanner.cpp
	modified:   be/src/runtime/stream_load/stream_load_executor.cpp
	modified:   docs/en/sql-reference/information_schema/load_tracking_logs.md
	modified:   docs/zh/sql-reference/information_schema/load_tracking_logs.md
	modified:   fe/fe-core/src/main/java/com/starrocks/catalog/ScalarType.java
	modified:   fe/fe-core/src/main/java/com/starrocks/catalog/system/information/LoadTrackingLogsSystemTable.java
	modified:   fe/fe-core/src/main/java/com/starrocks/catalog/system/information/LoadsSystemTable.java
	modified:   fe/fe-core/src/main/java/com/starrocks/common/Config.java
	modified:   fe/fe-core/src/main/java/com/starrocks/http/rest/TransactionLoadAction.java
	modified:   fe/fe-core/src/main/java/com/starrocks/http/rest/transaction/TransactionWithChannelHandler.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/EtlStatus.java
	new file:   fe/fe-core/src/main/java/com/starrocks/load/LoadConstants.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/loadv2/BrokerLoadJob.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/loadv2/InsertLoadJob.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/loadv2/LoadJob.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/loadv2/LoadMgr.java
	new file:   fe/fe-core/src/main/java/com/starrocks/load/loadv2/LoadsHistorySyncer.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/loadv2/ManualLoadTxnCommitAttachment.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/routineload/RoutineLoadJob.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/streamload/StreamLoadMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/streamload/StreamLoadTask.java
	modified:   fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java
	modified:   fe/fe-core/src/main/java/com/starrocks/server/GlobalStateMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/service/FrontendServiceImpl.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/plan/PlanFragmentBuilder.java
	modified:   fe/fe-core/src/main/java/com/starrocks/transaction/GlobalTransactionMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/transaction/TransactionState.java
	modified:   fe/fe-core/src/test/java/com/starrocks/http/TransactionLoadActionTest.java
	modified:   fe/fe-core/src/test/java/com/starrocks/load/streamload/ShowStreamLoadTest.java
	modified:   fe/fe-core/src/test/java/com/starrocks/load/streamload/StreamLoadManagerTest.java
	modified:   fe/fe-core/src/test/java/com/starrocks/load/streamload/StreamLoadTaskTest.java
	modified:   gensrc/thrift/FrontendService.thrift
	modified:   test/sql/test_information_schema/R/test_loads
	modified:   test/sql/test_information_schema/T/test_loads
	modified:   test/sql/test_insert_empty/R/test_insert
	modified:   test/sql/test_insert_empty/T/test_insert

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/main/java/com/starrocks/http/rest/RestBaseAction.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 Sep 9, 2024

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

@mergify mergify bot deleted the mergify/bp/branch-3.3/pr-46773 branch September 9, 2024 09:05
@meegoo meegoo restored the mergify/bp/branch-3.3/pr-46773 branch September 9, 2024 09:06
@meegoo meegoo reopened this Sep 13, 2024
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) September 13, 2024 08:19
@meegoo meegoo disabled auto-merge October 11, 2024 11:12
@meegoo meegoo enabled auto-merge (squash) October 11, 2024 11:12
Copy link

sonarcloud bot commented Oct 11, 2024

@meegoo meegoo merged commit 98464f5 into branch-3.3 Oct 11, 2024
32 of 33 checks passed
@meegoo meegoo deleted the mergify/bp/branch-3.3/pr-46773 branch October 11, 2024 12:46
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