You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/01/28 02:09:46 UTC

[GitHub] [hive] EugeneChung opened a new pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

EugeneChung opened a new pull request #1919:
URL: https://github.com/apache/hive/pull/1919


   <!--
   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.
   -->
   https://issues.apache.org/jira/browse/HIVE-23458
   
   Add the unified scheduled executor service for periodic tasks.
   
   ### 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.
   -->
   
   Like Metastore's org.apache.hadoop.hive.metastore.ThreadPool, I think the unified scheduled executor looks desirable to remove unnecessary thread creation or thread leak cases.
   
   Plus, I think it could help
   1. to minimize the possibility of making non-daemon threads when developers need ScheduledExecutorService
   2. to achieve the utilization of server resources because the current situation is all of the modules make its own ScheduledExecutorService and all of the threads are just using for one job.
   3. administrators of Hive servers by providing hive.exec.scheduler.num.threads configuration so that they can predict and set how many threads are used and needed.
   
   ### 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'.
   -->
   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 patch was applied on the hiveserver2 instances of my company's environment.
   


----------------------------------------------------------------
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.

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


[GitHub] [hive] EugeneChung commented on pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung commented on pull request #1919:
URL: https://github.com/apache/hive/pull/1919#issuecomment-777071053


   It's just failure of downloading mariadb docker image.
   
   ```
   [2021-02-03T17:47:35.784Z] Unable to find image 'mariadb:latest' locally
   
   [2021-02-03T17:47:36.736Z] latest: Pulling from library/mariadb
   
   [2021-02-03T17:47:36.737Z] docker: unauthorized: authentication required.
   
   [2021-02-03T17:47:36.737Z] See 'docker run --help'.
   
   script returned exit code 125
   ```


----------------------------------------------------------------
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.

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


[GitHub] [hive] EugeneChung commented on a change in pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung commented on a change in pull request #1919:
URL: https://github.com/apache/hive/pull/1919#discussion_r568859509



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -746,6 +746,8 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "This value must not contain any special character used in HDFS URI (e.g., ':', '%', '/' etc). \n" +
         "The user has to be aware that the dynamic partition value should not contain this value to avoid confusions."),
     DEFAULT_ZOOKEEPER_PARTITION_NAME("hive.lockmgr.zookeeper.default.partition.name", "__HIVE_DEFAULT_ZOOKEEPER_PARTITION__", ""),
+    HIVE_EXEC_SCHEDULED_POOL_NUM_THREADS("hive.exec.scheduler.num.threads", 10,

Review comment:
       https://github.com/EugeneChung/hive/commit/ccf6ed68b62cfe71a9014abd4e58cb7eeac44d44 I set it to 2.




----------------------------------------------------------------
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.

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


[GitHub] [hive] EugeneChung edited a comment on pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung edited a comment on pull request #1919:
URL: https://github.com/apache/hive/pull/1919#issuecomment-782619246


   I don't know why, but when the number of threads is 2, it seems to fail. So I set it to 4. I think 4 is small enough, too.


-- 
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.

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


[GitHub] [hive] EugeneChung edited a comment on pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung edited a comment on pull request #1919:
URL: https://github.com/apache/hive/pull/1919#issuecomment-808207986


   If hive.query.timeout.seconds is set to bigger than 0, a new thread is always created (and destroyed) for every SQL operation by calling Executors.newSingleThreadScheduledExecutor(). The unified scheduler pool removes this inefficiency.


-- 
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.

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


[GitHub] [hive] EugeneChung commented on a change in pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung commented on a change in pull request #1919:
URL: https://github.com/apache/hive/pull/1919#discussion_r568842878



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -746,6 +746,8 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "This value must not contain any special character used in HDFS URI (e.g., ':', '%', '/' etc). \n" +
         "The user has to be aware that the dynamic partition value should not contain this value to avoid confusions."),
     DEFAULT_ZOOKEEPER_PARTITION_NAME("hive.lockmgr.zookeeper.default.partition.name", "__HIVE_DEFAULT_ZOOKEEPER_PARTITION__", ""),
+    HIVE_EXEC_SCHEDULED_POOL_NUM_THREADS("hive.exec.scheduler.num.threads", 10,

Review comment:
       Yes, the role of corepoolsize is exactly what you understand.
   
   The reason I set to 10 is just because `metastore.thread.pool.size` is 10. I think 2 would be good.

##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -746,6 +746,8 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "This value must not contain any special character used in HDFS URI (e.g., ':', '%', '/' etc). \n" +
         "The user has to be aware that the dynamic partition value should not contain this value to avoid confusions."),
     DEFAULT_ZOOKEEPER_PARTITION_NAME("hive.lockmgr.zookeeper.default.partition.name", "__HIVE_DEFAULT_ZOOKEEPER_PARTITION__", ""),
+    HIVE_EXEC_SCHEDULED_POOL_NUM_THREADS("hive.exec.scheduler.num.threads", 10,

Review comment:
       https://github.com/EugeneChung/hive/commit/ccf6ed68b62cfe71a9014abd4e58cb7eeac44d44 I set it to 2.




----------------------------------------------------------------
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.

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


[GitHub] [hive] EugeneChung edited a comment on pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung edited a comment on pull request #1919:
URL: https://github.com/apache/hive/pull/1919#issuecomment-808207986






-- 
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.

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


[GitHub] [hive] github-actions[bot] commented on pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1919:
URL: https://github.com/apache/hive/pull/1919#issuecomment-871000002


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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


[GitHub] [hive] EugeneChung edited a comment on pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung edited a comment on pull request #1919:
URL: https://github.com/apache/hive/pull/1919#issuecomment-808207986


   If hive.query.timeout.seconds is set to bigger than 0, a new thread is always created (and just destroyed) for every SQL operation by calling Executors.newSingleThreadScheduledExecutor(). Most of the scheduled tasks for cancelling the operation wouldn't be called, too. The unified scheduler pool removes those inefficiencies.


-- 
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.

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


[GitHub] [hive] kgyrtkirk commented on a change in pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
kgyrtkirk commented on a change in pull request #1919:
URL: https://github.com/apache/hive/pull/1919#discussion_r566790677



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -746,6 +746,8 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "This value must not contain any special character used in HDFS URI (e.g., ':', '%', '/' etc). \n" +
         "The user has to be aware that the dynamic partition value should not contain this value to avoid confusions."),
     DEFAULT_ZOOKEEPER_PARTITION_NAME("hive.lockmgr.zookeeper.default.partition.name", "__HIVE_DEFAULT_ZOOKEEPER_PARTITION__", ""),
+    HIVE_EXEC_SCHEDULED_POOL_NUM_THREADS("hive.exec.scheduler.num.threads", 10,

Review comment:
       iiuc this is the corepoolsize of the threadpool (max is INT_MAX) - setting it to 10 means that the threadpool will keep 10 threads in standby mode for us at all time;
   I think we should probably be more conservative with this - what do you think about 1 or 2?




----------------------------------------------------------------
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.

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


[GitHub] [hive] EugeneChung commented on pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung commented on pull request #1919:
URL: https://github.com/apache/hive/pull/1919#issuecomment-808207986


   If hive.query.timeout.seconds is set to bigger than 0, a new thread is always created (and destroyed) for every SQL operation. The unified scheduler pool removes this inefficiency.


-- 
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.

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


[GitHub] [hive] EugeneChung commented on pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung commented on pull request #1919:
URL: https://github.com/apache/hive/pull/1919#issuecomment-782619246


   I don't know why but when the number of threads is 2, it seems to fail. So I set it to 4. I think it's small enough.


----------------------------------------------------------------
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.

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


[GitHub] [hive] kgyrtkirk commented on a change in pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
kgyrtkirk commented on a change in pull request #1919:
URL: https://github.com/apache/hive/pull/1919#discussion_r566790677



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -746,6 +746,8 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "This value must not contain any special character used in HDFS URI (e.g., ':', '%', '/' etc). \n" +
         "The user has to be aware that the dynamic partition value should not contain this value to avoid confusions."),
     DEFAULT_ZOOKEEPER_PARTITION_NAME("hive.lockmgr.zookeeper.default.partition.name", "__HIVE_DEFAULT_ZOOKEEPER_PARTITION__", ""),
+    HIVE_EXEC_SCHEDULED_POOL_NUM_THREADS("hive.exec.scheduler.num.threads", 10,

Review comment:
       iiuc this is the corepoolsize of the threadpool (max is INT_MAX) - setting it to 10 means that the threadpool will keep 10 threads in standby mode for us at all time;
   I think we should probably be more conservative with this - what do you think about 1 or 2?




----------------------------------------------------------------
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.

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


[GitHub] [hive] EugeneChung commented on a change in pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
EugeneChung commented on a change in pull request #1919:
URL: https://github.com/apache/hive/pull/1919#discussion_r568842878



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -746,6 +746,8 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "This value must not contain any special character used in HDFS URI (e.g., ':', '%', '/' etc). \n" +
         "The user has to be aware that the dynamic partition value should not contain this value to avoid confusions."),
     DEFAULT_ZOOKEEPER_PARTITION_NAME("hive.lockmgr.zookeeper.default.partition.name", "__HIVE_DEFAULT_ZOOKEEPER_PARTITION__", ""),
+    HIVE_EXEC_SCHEDULED_POOL_NUM_THREADS("hive.exec.scheduler.num.threads", 10,

Review comment:
       Yes, the role of corepoolsize is exactly what you understand.
   
   The reason I set to 10 is just because `metastore.thread.pool.size` is 10. I think 2 would be good.




----------------------------------------------------------------
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.

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


[GitHub] [hive] github-actions[bot] closed pull request #1919: HIVE-23458: Introduce unified thread pool for scheduled jobs

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1919:
URL: https://github.com/apache/hive/pull/1919


   


-- 
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