[ https://issues.apache.org/jira/browse/HIVE-21841?focusedWorklogId=261172&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-261172 ]
ASF GitHub Bot logged work on HIVE-21841: ----------------------------------------- Author: ASF GitHub Bot Created on: 17/Jun/19 06:16 Start Date: 17/Jun/19 06:16 Worklog Time Spent: 10m Work Description: ashutosh-bapat commented on pull request #668: HIVE-21841 : Add configuration to specify the hostname of HMS leader …to run housekeeping tasks in. URL: https://github.com/apache/hive/pull/668#discussion_r294147604 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java ########## @@ -9723,7 +9732,6 @@ public static void main(String[] args) throws Throwable { Lock startLock = new ReentrantLock(); Condition startCondition = startLock.newCondition(); AtomicBoolean startedServing = new AtomicBoolean(); - startMetaStoreThreads(conf, startLock, startCondition, startedServing); Review comment: No they aren't. In fact startMetaStore() doesn't know about these threads (without this change that is). The only condition is that these threads should be started before we call tServe.serve() as explained by the comment in startMetaStore(). We can not start these threads unless we know that the current HMS is a leader HMS. That happens after socket is bound. That's why I had to push startMetaStoreThreads() inside startMetaStore(). The way it's placed now, we won't spend time in starting these threads when the bind fails or creating TServer thread pool fails for any reason. So, we are actually saving on some resources in case of failures. ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 261172) Time Spent: 1h 40m (was: 1.5h) > Leader election in HMS to run housekeeping tasks. > ------------------------------------------------- > > Key: HIVE-21841 > URL: https://issues.apache.org/jira/browse/HIVE-21841 > Project: Hive > Issue Type: New Feature > Affects Versions: 4.0.0 > Reporter: Ashutosh Bapat > Assignee: Ashutosh Bapat > Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-21841.01.patch, HIVE-21841.02.patch > > Time Spent: 1h 40m > Remaining Estimate: 0h > > HMS performs housekeeping tasks. When there are multiple HMSes we need to > have a leader HMS elected which will carry out those housekeeping tasks. > These tasks include execution of compaction tasks, auto-discovering > partitions for external tables, generation of compaction tasks, repl thread > etc. > Note that, though the code for compaction tasks, auto-discovery of partitions > etc. is in Hive, the actual tasks are initiated by an HMS configured to do > so. So, leader election is required only for HMS and not for HS2. -- This message was sent by Atlassian JIRA (v7.6.3#76005)