[
https://issues.apache.org/jira/browse/HIVE-14979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15595316#comment-15595316
]
Peter Vary edited comment on HIVE-14979 at 10/21/16 2:56 PM:
-------------------------------------------------------------
Hi [~sershe],
I am not sure what you mean about "ride over" of locks. By my tests, if the
HiveServer2 is killed by "kill -9" and restarted, the old locks remain only
until their timeout expires (max. 20 min). The new HiveServer2 will have a
different sessionId and will create different locks. So I think, if the session
timeout is lowered to a reasonable value we might not need the patch in the end
(it will not hurt to have the extra possibility, but adds complexity and
another source of error)
I am not absolutely sure about the LLAP because the code around it is not
trivial, but I think it uses a different timeout value in
LlapStatusServiceDriver.run():
{code}
HiveConf.setVar(conf, HiveConf.ConfVars.HIVE_ZOOKEEPER_SESSION_TIMEOUT, (conf
.getLong(CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS,
CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS_DEFAULT) +
"ms"));
{code}
The default value of CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS_DEFAULT is 10000 which
means 10s timeout in the end.
Thanks,
Peter
was (Author: pvary):
Hi [~sershe],
I am not sure what you mean about "ride over" of locks. By my tests, if the
HiveServer2 is killed by "kill -9" and restarted, the old locks remain only
until their timeout expires (max. 20 min). The new HiveServer2 will have a
different sessionId and will create different locks. So I think, if the session
timeout is lowered to a reasonable value we might not need the patch in the end
(it will not hurt to have the extra possibility, but adds complexity and
another source of error)
I am not absolutely sure about the LLAP because the code around it is not
trivial, but I think it uses a different timeout value in
LlapStatusServiceDriver.run():
{code}
HiveConf.setVar(conf, HiveConf.ConfVars.HIVE_ZOOKEEPER_SESSION_TIMEOUT, (conf
.getLong(CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS,
CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS_DEFAULT) +
"ms"));
{code}
The default value of CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS_DEFAULT is 10s.
Thanks,
Peter
> Removing stale Zookeeper locks at HiveServer2 initialization
> ------------------------------------------------------------
>
> Key: HIVE-14979
> URL: https://issues.apache.org/jira/browse/HIVE-14979
> Project: Hive
> Issue Type: Improvement
> Components: Locking
> Reporter: Peter Vary
> Assignee: Peter Vary
> Attachments: HIVE-14979.3.patch, HIVE-14979.4.patch, HIVE-14979.patch
>
>
> HiveServer2 could use Zookeeper to store token that indicate that particular
> tables are locked with the creation of persistent Zookeeper objects.
> A problem can occur when a HiveServer2 instance creates a lock on a table and
> the HiveServer2 instances crashes ("Out of Memory" for example) and the locks
> are not released in Zookeeper. This lock will then remain until it is
> manually cleared by an admin.
> There should be a way to remove stale locks at HiveServer2 initialization,
> helping the admins life.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)