You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/01 11:33:38 UTC
[GitHub] [doris] Kikyou1997 opened a new pull request, #14733: [ehancement](nereids) Read lock table on binding phase
Kikyou1997 opened a new pull request, #14733:
URL: https://github.com/apache/doris/pull/14733
# Proposed changes
Issue Number: close #xxx
## Problem summary
So that we could avoid some concurrentmodifications to the basic structures in FE
Describe your changes.
## Checklist(Required)
1. Does it affect the original behavior:
- [ ] Yes
- [ ] No
- [ ] I don't know
2. Has unit tests been added:
- [ ] Yes
- [ ] No
- [ ] No Need
3. Has document been added or modified:
- [ ] Yes
- [ ] No
- [ ] No Need
4. Does it need to update dependencies:
- [ ] Yes
- [ ] No
5. Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [ ] No
## 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] hello-stephen commented on pull request #14733: [ehancement](nereids) Read lock table on binding phase
Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #14733:
URL: https://github.com/apache/doris/pull/14733#issuecomment-1333651798
TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 34.55 seconds
load time: 429 seconds
storage size: 17123343100 Bytes
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20221201115417_clickbench_pr_56221.html
--
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] morrySnow commented on a diff in pull request #14733: [ehancement](nereids) Read lock table on binding phase
Posted by GitBox <gi...@apache.org>.
morrySnow commented on code in PR #14733:
URL: https://github.com/apache/doris/pull/14733#discussion_r1040565192
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/NereidsAnalyzer.java:
##########
@@ -54,4 +54,12 @@ public void analyze() {
// check whether analyze result is meaningful
new CheckAnalysisJob(cascadesContext).execute();
}
+
+ public void analyze(boolean cte) {
Review Comment:
parameter is not use
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/batch/AnalyzeRulesJob.java:
##########
@@ -68,4 +66,24 @@ public AnalyzeRulesJob(CascadesContext cascadesContext, Optional<Scope> scope) {
))
));
}
+
+ @Override
+ public void execute() {
+ boolean locked = false;
+ try {
+ Job j = bottomUpBatch(ImmutableList.of(
+ new RegisterCTE()
+ ));
Review Comment:
why move rigisterCTE job?
--
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] 924060929 commented on pull request #14733: [ehancement](nereids) Read lock table on binding phase
Posted by GitBox <gi...@apache.org>.
924060929 commented on PR #14733:
URL: https://github.com/apache/doris/pull/14733#issuecomment-1340918506
I think table read lock should span the statement lifecycle, and use the `Stack<ReentrantReadWriteLock>` save the lock order and then we can release by the reverse order. And you should try require read lock with timeout for prevent dead lock.
--
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] Kikyou1997 commented on pull request #14733: [ehancement](nereids) Read lock table when analyze and generate query plan
Posted by GitBox <gi...@apache.org>.
Kikyou1997 commented on PR #14733:
URL: https://github.com/apache/doris/pull/14733#issuecomment-1342652131
> I think table read lock should span the statement's planner lifecycle, the view and subquery maybe reentrant the same table lock. And you should use the `Stack<ReentrantReadWriteLock>` in the StatementContext to save the lock order and then we can release by the reverse order after exit the planner, catch Throwable should be considered. And you should try require read lock with timeout for prevent dead lock.
Done, thanks for these suggestions
--
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 #14733: [ehancement](nereids) Read lock table when analyze and generate query plan
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14733:
URL: https://github.com/apache/doris/pull/14733#issuecomment-1343956065
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] github-actions[bot] commented on pull request #14733: [ehancement](nereids) Read lock table when analyze and generate query plan
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14733:
URL: https://github.com/apache/doris/pull/14733#issuecomment-1343956090
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] morrySnow commented on a diff in pull request #14733: [ehancement](nereids) Read lock table on binding phase
Posted by GitBox <gi...@apache.org>.
morrySnow commented on code in PR #14733:
URL: https://github.com/apache/doris/pull/14733#discussion_r1038158609
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java:
##########
@@ -197,4 +205,70 @@ private CascadesContext execute(Job job) {
jobScheduler.executeJobPool(this);
return this;
}
+
+ public void addToTable(Table table) {
+ tables.add(table);
+ }
+
+ public void lockTableOnRead() {
+ for (Table t : tables) {
+ t.readLock();
+ }
+ }
+
+ public void releaseTableReadLock() {
+ for (Table t : tables) {
+ t.readUnlock();
+ }
+ }
+
+ /**
+ * Find all tables to lock on.
+ */
+ public void extractTables() {
Review Comment:
add UT to ensure we could lock all tables when statement has view, cte, subquery in from clause and subquery in where/having clause
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java:
##########
@@ -197,4 +205,70 @@ private CascadesContext execute(Job job) {
jobScheduler.executeJobPool(this);
return this;
}
+
+ public void addToTable(Table table) {
Review Comment:
```suggestion
public void addTable(Table table) {
```
--
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] morrySnow merged pull request #14733: [ehancement](nereids) Read lock table when analyze and generate query plan
Posted by GitBox <gi...@apache.org>.
morrySnow merged PR #14733:
URL: https://github.com/apache/doris/pull/14733
--
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