You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "whutpencil (via GitHub)" <gi...@apache.org> on 2023/05/10 07:25:16 UTC
[GitHub] [doris] whutpencil opened a new pull request, #19492: [Enhancement] show total transactions in show proc "/transactions"
whutpencil opened a new pull request, #19492:
URL: https://github.com/apache/doris/pull/19492
# Proposed changes
Issue Number: close #xxx
## Problem summary
In a scenario where multiple DBs are simultaneously imported with high concurrency, a significant number of transactions will be generated. Without a summary field, we cannot clearly see how many transactions there are in the current cluster. Therefore, I have enhanced this point.
mysql> show proc "/transactions";
+-------+-----------------------------------+-----------------------+
| DbId | DbName | RunningTransactionNum |
+-------+-----------------------------------+-----------------------+
| 10002 | default_cluster:xxxx | 0 |
| 14005 | default_cluster:__internal_schema | 0 |
| Total | 2 | 0 |
+-------+-----------------------------------+-----------------------+
3 rows in set (0.02 sec)

## Checklist(Required)
* [x] Does it affect the original behavior
* [x] Has unit tests been added
* [x] Has document been added or modified
* [x] Does it need to update dependencies
* [ ] Is this PR support rollback (If NO, please explain WHY)
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] whutpencil commented on a diff in pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "whutpencil (via GitHub)" <gi...@apache.org>.
whutpencil commented on code in PR #19492:
URL: https://github.com/apache/doris/pull/19492#discussion_r1193252941
##########
fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java:
##########
@@ -507,12 +511,15 @@ public List<List<Comparable>> getDbInfo() {
try {
DatabaseTransactionMgr dbMgr = getDatabaseTransactionMgr(dbId);
runningNum = dbMgr.getRunningTxnNums() + dbMgr.getRunningRoutineLoadTxnNums();
+ totalRunningNum += runningNum;
} catch (AnalysisException e) {
LOG.warn("get database running transaction num failed", e);
}
- info.add(runningNum);
+ info.add(String.valueOf(runningNum));
infos.add(info);
}
+ List<String> info = Arrays.asList("Total", String.valueOf(dbIds.size()), String.valueOf(totalRunningNum));
Review Comment:
@morningman done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] whutpencil commented on a diff in pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "whutpencil (via GitHub)" <gi...@apache.org>.
whutpencil commented on code in PR #19492:
URL: https://github.com/apache/doris/pull/19492#discussion_r1192125269
##########
fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java:
##########
@@ -507,12 +511,15 @@ public List<List<Comparable>> getDbInfo() {
try {
DatabaseTransactionMgr dbMgr = getDatabaseTransactionMgr(dbId);
runningNum = dbMgr.getRunningTxnNums() + dbMgr.getRunningRoutineLoadTxnNums();
+ totalRunningNum += runningNum;
} catch (AnalysisException e) {
LOG.warn("get database running transaction num failed", e);
}
- info.add(runningNum);
+ info.add(String.valueOf(runningNum));
infos.add(info);
}
+ List<String> info = Arrays.asList("Total", String.valueOf(dbIds.size()), String.valueOf(totalRunningNum));
Review Comment:
@morningman This is because in the show proc "/cluster_health/tablet_health" command, it was generated in my current format to maintain consistency. Do you think it still needs to be modified?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morningman commented on pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on PR #19492:
URL: https://github.com/apache/doris/pull/19492#issuecomment-1548809310
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19492:
URL: https://github.com/apache/doris/pull/19492#issuecomment-1548809750
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morningman commented on a diff in pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on code in PR #19492:
URL: https://github.com/apache/doris/pull/19492#discussion_r1192041751
##########
fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java:
##########
@@ -507,12 +511,15 @@ public List<List<Comparable>> getDbInfo() {
try {
DatabaseTransactionMgr dbMgr = getDatabaseTransactionMgr(dbId);
runningNum = dbMgr.getRunningTxnNums() + dbMgr.getRunningRoutineLoadTxnNums();
+ totalRunningNum += runningNum;
} catch (AnalysisException e) {
LOG.warn("get database running transaction num failed", e);
}
- info.add(runningNum);
+ info.add(String.valueOf(runningNum));
infos.add(info);
}
+ List<String> info = Arrays.asList("Total", String.valueOf(dbIds.size()), String.valueOf(totalRunningNum));
Review Comment:
For the last line, better use same schema for each column:
I suggest:
```
0, "Total", runningnum
```
So that the first column is always integer
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19492:
URL: https://github.com/apache/doris/pull/19492#issuecomment-1548809710
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morningman merged pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman merged PR #19492:
URL: https://github.com/apache/doris/pull/19492
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morningman commented on a diff in pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on code in PR #19492:
URL: https://github.com/apache/doris/pull/19492#discussion_r1192392132
##########
fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java:
##########
@@ -507,12 +511,15 @@ public List<List<Comparable>> getDbInfo() {
try {
DatabaseTransactionMgr dbMgr = getDatabaseTransactionMgr(dbId);
runningNum = dbMgr.getRunningTxnNums() + dbMgr.getRunningRoutineLoadTxnNums();
+ totalRunningNum += runningNum;
} catch (AnalysisException e) {
LOG.warn("get database running transaction num failed", e);
}
- info.add(runningNum);
+ info.add(String.valueOf(runningNum));
infos.add(info);
}
+ List<String> info = Arrays.asList("Total", String.valueOf(dbIds.size()), String.valueOf(totalRunningNum));
Review Comment:
Ooh, I didn't notice that in `show proc "/cluster_health/tablet_health"`, it is not a very good design.
I think we can make this right, and change that later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morningman commented on pull request #19492: [Enhancement] show total transactions in show proc "/transactions"
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on PR #19492:
URL: https://github.com/apache/doris/pull/19492#issuecomment-1551645140
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org