You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "vikramahuja1001 (via GitHub)" <gi...@apache.org> on 2026/05/27 12:09:47 UTC

[PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

vikramahuja1001 opened a new pull request, #6510:
URL: https://github.com/apache/hive/pull/6510

   
   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #6510:
URL: https://github.com/apache/hive/pull/6510#discussion_r3332035618


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SimpleFetchOptimizer.java:
##########
@@ -144,8 +145,15 @@ private FetchTask optimize(ParseContext pctx, String alias, TableScanOperator so
     if (fetch != null && checkThreshold(fetch, limit, pctx)) {
       FetchWork fetchWork = fetch.convertToWork();
       FetchTask fetchTask = (FetchTask) TaskFactory.get(fetchWork);
-      fetchTask.setCachingEnabled(HiveConf.getBoolVar(pctx.getConf(),
-              HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING));
+      boolean cachingEnabled = HiveConf.getBoolVar(pctx.getConf(),
+          HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING);
+      if (cachingEnabled && !AcidUtils.isTransactionalTable(fetch.table)) {
+        LOG.debug("Fetch task caching is enabled but table {} is not transactional. " +
+            "Caching is only supported for ACID tables to prevent Cleaner race conditions. Disabling.",

Review Comment:
   what are those `Cleaner race conditions`? regardless flag only make sense for ACID tables
   
   i think this whole thing is no longer needed - Cleaner doesn't use lock in Hive-4.x



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "vikramahuja1001 (via GitHub)" <gi...@apache.org>.
vikramahuja1001 commented on PR #6510:
URL: https://github.com/apache/hive/pull/6510#issuecomment-5093669060

   Thanks for merging this PR @ayushtkn 


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "vikramahuja1001 (via GitHub)" <gi...@apache.org>.
vikramahuja1001 commented on PR #6510:
URL: https://github.com/apache/hive/pull/6510#issuecomment-4785816209

   Cc @deniskuzZ , could you please take a look at this PR once you get a chance?


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #6510:
URL: https://github.com/apache/hive/pull/6510#issuecomment-4599277243

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6510) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6510&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6510&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=6510&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6510&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6510&metric=new_duplicated_lines_density&view=list)  
     
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6510)
   
   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn merged PR #6510:
URL: https://github.com/apache/hive/pull/6510


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "vikramahuja1001 (via GitHub)" <gi...@apache.org>.
vikramahuja1001 commented on PR #6510:
URL: https://github.com/apache/hive/pull/6510#issuecomment-4604624293

   @deniskuzZ , the build is green for this PR. Can you kindly recheck this PR?


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "vikramahuja1001 (via GitHub)" <gi...@apache.org>.
vikramahuja1001 commented on PR #6510:
URL: https://github.com/apache/hive/pull/6510#issuecomment-5002426059

   @deniskuzZ / @ayushtkn / @dengzhhu653 / @zabetak / @saihemanth-cloudera Can you help to review this PR as well? Thanks


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #6510:
URL: https://github.com/apache/hive/pull/6510#issuecomment-4595362893

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6510) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6510&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6510&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=6510&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6510&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6510&metric=new_duplicated_lines_density&view=list)  
     
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6510)
   
   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #6510:
URL: https://github.com/apache/hive/pull/6510#discussion_r3332035618


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SimpleFetchOptimizer.java:
##########
@@ -144,8 +145,15 @@ private FetchTask optimize(ParseContext pctx, String alias, TableScanOperator so
     if (fetch != null && checkThreshold(fetch, limit, pctx)) {
       FetchWork fetchWork = fetch.convertToWork();
       FetchTask fetchTask = (FetchTask) TaskFactory.get(fetchWork);
-      fetchTask.setCachingEnabled(HiveConf.getBoolVar(pctx.getConf(),
-              HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING));
+      boolean cachingEnabled = HiveConf.getBoolVar(pctx.getConf(),
+          HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING);
+      if (cachingEnabled && !AcidUtils.isTransactionalTable(fetch.table)) {
+        LOG.debug("Fetch task caching is enabled but table {} is not transactional. " +
+            "Caching is only supported for ACID tables to prevent Cleaner race conditions. Disabling.",

Review Comment:
   what are those `Cleaner race conditions`? regardless flag only make sense for ACID tables



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #6510:
URL: https://github.com/apache/hive/pull/6510#discussion_r3332035618


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SimpleFetchOptimizer.java:
##########
@@ -144,8 +145,15 @@ private FetchTask optimize(ParseContext pctx, String alias, TableScanOperator so
     if (fetch != null && checkThreshold(fetch, limit, pctx)) {
       FetchWork fetchWork = fetch.convertToWork();
       FetchTask fetchTask = (FetchTask) TaskFactory.get(fetchWork);
-      fetchTask.setCachingEnabled(HiveConf.getBoolVar(pctx.getConf(),
-              HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING));
+      boolean cachingEnabled = HiveConf.getBoolVar(pctx.getConf(),
+          HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING);
+      if (cachingEnabled && !AcidUtils.isTransactionalTable(fetch.table)) {
+        LOG.debug("Fetch task caching is enabled but table {} is not transactional. " +
+            "Caching is only supported for ACID tables to prevent Cleaner race conditions. Disabling.",

Review Comment:
   what are those `Cleaner race conditions`?



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #6510:
URL: https://github.com/apache/hive/pull/6510#issuecomment-4554913175

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6510) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6510&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6510&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=6510&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6510&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6510&metric=new_duplicated_lines_density&view=list)  
     
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6510)
   
   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #6510:
URL: https://github.com/apache/hive/pull/6510#discussion_r3332035618


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SimpleFetchOptimizer.java:
##########
@@ -144,8 +145,15 @@ private FetchTask optimize(ParseContext pctx, String alias, TableScanOperator so
     if (fetch != null && checkThreshold(fetch, limit, pctx)) {
       FetchWork fetchWork = fetch.convertToWork();
       FetchTask fetchTask = (FetchTask) TaskFactory.get(fetchWork);
-      fetchTask.setCachingEnabled(HiveConf.getBoolVar(pctx.getConf(),
-              HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING));
+      boolean cachingEnabled = HiveConf.getBoolVar(pctx.getConf(),
+          HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING);
+      if (cachingEnabled && !AcidUtils.isTransactionalTable(fetch.table)) {
+        LOG.debug("Fetch task caching is enabled but table {} is not transactional. " +
+            "Caching is only supported for ACID tables to prevent Cleaner race conditions. Disabling.",

Review Comment:
   what are those `Cleaner race conditions`? regardless, flag only make sense for ACID tables
   
   PS: i think this whole thing is obsolete since Cleaner doesn't use lock in Hive-4.x.
   cc @kuczoram 



##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SimpleFetchOptimizer.java:
##########
@@ -144,8 +145,15 @@ private FetchTask optimize(ParseContext pctx, String alias, TableScanOperator so
     if (fetch != null && checkThreshold(fetch, limit, pctx)) {
       FetchWork fetchWork = fetch.convertToWork();
       FetchTask fetchTask = (FetchTask) TaskFactory.get(fetchWork);
-      fetchTask.setCachingEnabled(HiveConf.getBoolVar(pctx.getConf(),
-              HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING));
+      boolean cachingEnabled = HiveConf.getBoolVar(pctx.getConf(),
+          HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING);
+      if (cachingEnabled && !AcidUtils.isTransactionalTable(fetch.table)) {
+        LOG.debug("Fetch task caching is enabled but table {} is not transactional. " +
+            "Caching is only supported for ACID tables to prevent Cleaner race conditions. Disabling.",

Review Comment:
   what are those `Cleaner race conditions`? regardless, flag only make sense for ACID tables
   
   PS: i think this whole thing is obsolete since Cleaner doesn't use locks in Hive-4.x.
   cc @kuczoram 



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "vikramahuja1001 (via GitHub)" <gi...@apache.org>.
vikramahuja1001 commented on code in PR #6510:
URL: https://github.com/apache/hive/pull/6510#discussion_r3342820554


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SimpleFetchOptimizer.java:
##########
@@ -144,8 +145,15 @@ private FetchTask optimize(ParseContext pctx, String alias, TableScanOperator so
     if (fetch != null && checkThreshold(fetch, limit, pctx)) {
       FetchWork fetchWork = fetch.convertToWork();
       FetchTask fetchTask = (FetchTask) TaskFactory.get(fetchWork);
-      fetchTask.setCachingEnabled(HiveConf.getBoolVar(pctx.getConf(),
-              HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING));
+      boolean cachingEnabled = HiveConf.getBoolVar(pctx.getConf(),
+          HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING);
+      if (cachingEnabled && !AcidUtils.isTransactionalTable(fetch.table)) {
+        LOG.debug("Fetch task caching is enabled but table {} is not transactional. " +
+            "Caching is only supported for ACID tables to prevent Cleaner race conditions. Disabling.",

Review Comment:
   Cleaned the Log statement



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "vikramahuja1001 (via GitHub)" <gi...@apache.org>.
vikramahuja1001 commented on PR #6510:
URL: https://github.com/apache/hive/pull/6510#issuecomment-4651113865

   @deniskuzZ , @zabetak , @zhangbutao , @ayushtkn could someone please check this PR when you get a chance? Thanks.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #6510:
URL: https://github.com/apache/hive/pull/6510#discussion_r3332035618


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SimpleFetchOptimizer.java:
##########
@@ -144,8 +145,15 @@ private FetchTask optimize(ParseContext pctx, String alias, TableScanOperator so
     if (fetch != null && checkThreshold(fetch, limit, pctx)) {
       FetchWork fetchWork = fetch.convertToWork();
       FetchTask fetchTask = (FetchTask) TaskFactory.get(fetchWork);
-      fetchTask.setCachingEnabled(HiveConf.getBoolVar(pctx.getConf(),
-              HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING));
+      boolean cachingEnabled = HiveConf.getBoolVar(pctx.getConf(),
+          HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING);
+      if (cachingEnabled && !AcidUtils.isTransactionalTable(fetch.table)) {
+        LOG.debug("Fetch task caching is enabled but table {} is not transactional. " +
+            "Caching is only supported for ACID tables to prevent Cleaner race conditions. Disabling.",

Review Comment:
   what are those `Cleaner race conditions`? regardless flag only make sense for ACID tables
   
   i think this whole thing is obsolete since Cleaner doesn't use lock in Hive-4.x.
   cc @kuczoram 



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #6510:
URL: https://github.com/apache/hive/pull/6510#discussion_r3332035618


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SimpleFetchOptimizer.java:
##########
@@ -144,8 +145,15 @@ private FetchTask optimize(ParseContext pctx, String alias, TableScanOperator so
     if (fetch != null && checkThreshold(fetch, limit, pctx)) {
       FetchWork fetchWork = fetch.convertToWork();
       FetchTask fetchTask = (FetchTask) TaskFactory.get(fetchWork);
-      fetchTask.setCachingEnabled(HiveConf.getBoolVar(pctx.getConf(),
-              HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING));
+      boolean cachingEnabled = HiveConf.getBoolVar(pctx.getConf(),
+          HiveConf.ConfVars.HIVE_FETCH_TASK_CACHING);
+      if (cachingEnabled && !AcidUtils.isTransactionalTable(fetch.table)) {
+        LOG.debug("Fetch task caching is enabled but table {} is not transactional. " +
+            "Caching is only supported for ACID tables to prevent Cleaner race conditions. Disabling.",

Review Comment:
   what are those `Cleaner race conditions`? regardless, flag only make sense for ACID tables
   
   i think this whole thing is obsolete since Cleaner doesn't use lock in Hive-4.x.
   cc @kuczoram 



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-29632: hive.fetch.task.caching=true causes unbounded heap allocation thus crashing HiveServer2 with OutOfMemoryError [hive]

Posted by "vikramahuja1001 (via GitHub)" <gi...@apache.org>.
vikramahuja1001 commented on code in PR #6510:
URL: https://github.com/apache/hive/pull/6510#discussion_r3342884165


##########
cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java:
##########
@@ -295,7 +295,9 @@ CommandProcessorResponse processLocalCmd(String cmd, CommandProcessor proc, CliS
           console.printError("Failed with exception " + e.getClass().getName() + ":" + e.getMessage(),
               "\n" + org.apache.hadoop.util.StringUtils.stringifyException(e));
           throw new CommandProcessorException(1);
-        } finally {
+        } catch (RuntimeException e) {

Review Comment:
   Reason for this change:
   1. The SimpleFetchOptimizer change disables caching for non-ACID tables, making FetchTask.execute() a no op. Rows are now fetched lazily via Driver.getResults() after qp.run(). So the exceptions that previously surfaced inside qp.run() now escapes as unchecked RunTimeException from the fetch loop.
   2. ProcessLocalCmd() only caught IOExceptions, so the RunTImeException bubbled up and never became a CommandProcessorException causing tests tests like, udf_assert_true.q, udf_assert_true2.q to fail.
   3. The fix adds a separate catch (RuntimeException e) that silently converts it to CommandProcessorException. It intentionally does not reprint the error since FetchTask.executeInner() already did that. Plus doing that will change .q.out file which i was trying to avoid.



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org