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

[Bug][SqlTask] Set maxRows in SqlTask #15342

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

ruanwenjun
Copy link
Member

@ruanwenjun ruanwenjun commented Dec 19, 2023

Purpose of the pull request

I find when we select from a large table, the limit configuration in the ui will not be used, this will cause the worker oom.

image

Once the result count is larger than limit, it will not be used, so we don't need to fetch all records.

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@ruanwenjun ruanwenjun added the improvement make more easy to user or prompt friendly label Dec 19, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (f8a44ff) 37.80% compared to head (b798667) 37.81%.

❗ Current head b798667 differs from pull request most recent head 6e90816. Consider uploading reports for the commit 6e90816 to get more accurate results

Files Patch % Lines
...ache/dolphinscheduler/plugin/task/sql/SqlTask.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##                dev   #15342   +/-   ##
=========================================
  Coverage     37.80%   37.81%           
  Complexity     4701     4701           
=========================================
  Files          1304     1304           
  Lines         45221    45216    -5     
  Branches       4859     4858    -1     
=========================================
+ Hits          17098    17099    +1     
+ Misses        26260    26254    -6     
  Partials       1863     1863           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@EricGao888 EricGao888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides making the limit take effect, I think probably we still need to add some limits by default for something like select *. If users do not add limit explicitly, it seems they still could make worker OOM.

@qingwli
Copy link
Member

qingwli commented Dec 20, 2023

ERROR: 1 dead links found!
[✖] https://twitter.com/dolphinschedule → Status: 400

But I test works well locally

@EricGao888
Copy link
Member

ERROR: 1 dead links found!
[✖] https://twitter.com/dolphinschedule → Status: 400

But I test works well locally

@qingwli It could happen. The network of github actions machine is different from your local network.

@ruanwenjun
Copy link
Member Author

Besides making the limit take effect, I think probably we still need to add some limits by default for something like select *. If users do not add limit explicitly, it seems they still could make worker OOM.

We will use default number QUERY_LIMIT if user doesn't set limit.

@EricGao888
Copy link
Member

Besides making the limit take effect, I think probably we still need to add some limits by default for something like select *. If users do not add limit explicitly, it seems they still could make worker OOM.

We will use default number QUERY_LIMIT if user doesn't set limit.

Got it

(cherry picked from commit b6b88e3e62d8245e08408fb60c48d23c0bd0bb46)
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_setMaxRows branch from 09bf728 to 6e90816 Compare December 21, 2023 10:54
@ruanwenjun ruanwenjun changed the title Set maxRows in SqlTask [Bug][SqlTask] Set maxRows in SqlTask Dec 21, 2023
@ruanwenjun ruanwenjun added the bug Something isn't working label Dec 21, 2023
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

@ruanwenjun ruanwenjun merged commit f921457 into apache:dev Dec 21, 2023
51 of 52 checks passed
@ruanwenjun ruanwenjun deleted the dev_wenjun_setMaxRows branch December 21, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working improvement make more easy to user or prompt friendly ready-to-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants