You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tajo.apache.org by combineads <gi...@git.apache.org> on 2016/01/06 07:54:34 UTC

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

GitHub user combineads opened a pull request:

    https://github.com/apache/tajo/pull/928

    TAJO-2036: Prevent out of memory in the master server, if the query result is large

    This problem will occur frequently in our production server.
    Please confirm.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/combineads/tajo TAJO-2036

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tajo/pull/928.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #928
    
----
commit 09387b86df03cb1a53fd82da650038a8a0dd364a
Author: Byunghwa Yun <co...@combineads.co.kr>
Date:   2016-01-06T06:24:26Z

    TAJO-2036: Prevent out of memory in the master server, if the query
    result is large

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/928#discussion_r48938840
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/webapp/QueryExecutorServlet.java ---
    @@ -507,14 +508,20 @@ private void MakeResultText(ResultSet res, TableDesc desc) throws SQLException {
             numOfRows = resultRows;
           }
     
    +      int currentResultSize = 0;
           int rowCount = 0;
           while (res.next()) {
    -        if(rowCount > numOfRows) {
    +        if(rowCount > numOfRows || currentResultSize > sizeLimit) {
    --- End diff --
    
    ```numOfRows = (long)((float)(resultRows) * ((float)sizeLimit / (float) resultRows));``` on the 506 line looks not necessary. Would you remove it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on the pull request:

    https://github.com/apache/tajo/pull/928#issuecomment-176009149
  
    +1 LGTM. This patch does not relate to unit tests.
    I'll commit shortly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/928#discussion_r51080021
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/webapp/QueryExecutorServlet.java ---
    @@ -197,7 +203,6 @@ public void service(HttpServletRequest request,
                 errorResponse(response, queryRunner.error);
                 return;
               }
    -          returnValue.put("numOfRows", queryRunner.numOfRows);
    --- End diff --
    
    Oh, my mistake. Never mind.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on the pull request:

    https://github.com/apache/tajo/pull/928#issuecomment-171892339
  
    @combineads, sorry for late response. 
    Actually, my intention was to keep both factors, but clean some unnecessary codes.
    I think we need to keep only the max number of rows rather than max byte size in the future. However, for now, it would be ok if we support both factors. How about adding the max number of rows again?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/928#discussion_r51079765
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/webapp/QueryExecutorServlet.java ---
    @@ -197,7 +203,6 @@ public void service(HttpServletRequest request,
                 errorResponse(response, queryRunner.error);
                 return;
               }
    -          returnValue.put("numOfRows", queryRunner.numOfRows);
    --- End diff --
    
    limitRow also needs to be added to returnValue.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/tajo/pull/928


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by combineads <gi...@git.apache.org>.
Github user combineads commented on the pull request:

    https://github.com/apache/tajo/pull/928#issuecomment-175980187
  
    Hi @jihoonson .
    I did to remove the max row limit.
    Thank you for review.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by combineads <gi...@git.apache.org>.
Github user combineads commented on the pull request:

    https://github.com/apache/tajo/pull/928#issuecomment-171590158
  
    @jihoonson Anything else to commit this PR?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by combineads <gi...@git.apache.org>.
Github user combineads commented on the pull request:

    https://github.com/apache/tajo/pull/928#issuecomment-173855449
  
    Hi @jihoonson .
    I did to add the row limit field.
    Thank you for review.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-2036: Prevent out of memory in the master ...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/928#discussion_r51079959
  
    --- Diff: tajo-core/src/main/resources/webapps/admin/query_executor.jsp ---
    @@ -87,6 +88,11 @@ function runQuery() {
       } else if(Math.ceil(Number($("#sizeLimit").val())) > 0) {
         SIZE_LIMIT = Number($("#sizeLimit").val()) * 1024 * 1024;
       }
    +  if(Math.ceil(Number($("#rowLimit").val())) >= 10) {
    --- End diff --
    
    IMO, we don't have to set the upper bound. It would be better to allow a very large value for rowLimit if users want.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---