hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yongzhi Chen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-15572) Improve the response time for query canceling when it happens during acquiring locks
Date Wed, 11 Jan 2017 22:16:16 GMT

    [ https://issues.apache.org/jira/browse/HIVE-15572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819345#comment-15819345
] 

Yongzhi Chen commented on HIVE-15572:
-------------------------------------

Following is the cancelling log after the fix, for the same test query, the aquire and release
lock use half the time.
{noformat}
2017-01-10 07:56:57,791 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-56]: <PERFLOG method=TimeToSubmit from=org.apache.hadoop.hive.ql.Driver>
2017-01-10 07:56:57,791 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-56]: <PERFLOG method=acquireReadWriteLocks from=org.apache.hadoop.hive.ql.Driver>
2017-01-10 07:58:18,180 ERROR org.apache.hadoop.hive.ql.Driver: [HiveServer2-Background-Pool:
Thread-56]: FAILED: Error in acquiring locks: Query cancelled while acquiring Locks on the
underlying objects. 
org.apache.hadoop.hive.ql.lockmgr.LockException: Query cancelled while acquiring Locks on
the underlying objects. 
	at org.apache.hadoop.hive.ql.lockmgr.DummyTxnManager.acquireLocks(DummyTxnManager.java:172)
	at org.apache.hadoop.hive.ql.Driver.acquireLocksAndOpenTxn(Driver.java:1127)
	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1416)
	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1212)
	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1207)
	at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:237)
	at org.apache.hive.service.cli.operation.SQLOperation.access$300(SQLOperation.java:88)
	at org.apache.hive.service.cli.operation.SQLOperation$3$1.run(SQLOperation.java:293)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:415)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1796)
	at org.apache.hive.service.cli.operation.SQLOperation$3.run(SQLOperation.java:306)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

2017-01-10 07:58:18,181 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-56]: </PERFLOG method=acquireReadWriteLocks start=1484063817791 end=1484063898181
duration=80390 from=org.apache.hadoop.hive.ql.Driver>
2017-01-10 07:58:18,181 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-56]: <PERFLOG method=releaseLocks from=org.apache.hadoop.hive.ql.Driver>
2017-01-10 07:58:18,181 INFO  org.apache.hadoop.hive.ql.Driver: [HiveServer2-Background-Pool:
Thread-56]: After getTxnMgr
2017-01-10 07:58:18,181 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-56]: </PERFLOG method=releaseLocks start=1484063898181 end=1484063898181 duration=0
from=org.apache.hadoop.hive.ql.Driver>
{noformat}

[~ctang.ma], could you review the code?  Thanks

> Improve the response time for query canceling when it happens during acquiring locks
> ------------------------------------------------------------------------------------
>
>                 Key: HIVE-15572
>                 URL: https://issues.apache.org/jira/browse/HIVE-15572
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Yongzhi Chen
>            Assignee: Yongzhi Chen
>         Attachments: HIVE-15572.1.patch
>
>
> When query canceling command sent during Hive Acquire locks (from zookeeper), hive will
finish acquiring all the locks and release them. As it is shown in the following log:
> It took 165 s to finish acquire the lock,then spend 81s to release them.
> We can improve the performance by not acquiring any more locks and releasing held locks
when the query canceling command is received. 
> {noformat}
> Background-Pool: Thread-224]: <PERFLOG method=TimeToSubmit from=org.apache.hadoop.hive.ql.Driver>
> 2017-01-03 10:50:35,413 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-224]: <PERFLOG method=acquireReadWriteLocks from=org.apache.hadoop.hive.ql.Driver>
> 2017-01-03 10:51:00,671 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-218]: </PERFLOG method=acquireReadWriteLocks start=1483469295080 end=1483469460671
duration=165591 from=org.apache.hadoop.hive.ql.Driver>
> 2017-01-03 10:51:00,672 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-218]: <PERFLOG method=Driver.execute from=org.apache.hadoop.hive.ql.Driver>
> 2017-01-03 10:51:00,672 ERROR org.apache.hadoop.hive.ql.Driver: [HiveServer2-Background-Pool:
Thread-218]: FAILED: query select count(*) from manyparttbl has been cancelled
> 2017-01-03 10:51:00,673 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-218]: <PERFLOG method=releaseLocks from=org.apache.hadoop.hive.ql.Driver>
> 2017-01-03 10:51:40,755 INFO  org.apache.hadoop.hive.ql.log.PerfLogger: [HiveServer2-Background-Pool:
Thread-215]: </PERFLOG method=releaseLocks start=1483469419487 end=1483469500755 duration=81268
from=org.apache.hadoop.hive.ql.Driver>
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message