> On July 22, 2014, 10:33 p.m., Szehon Ho wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/lockmgr/zookeeper/ZooKeeperHiveLockManager.java,
> >  line 300
> > <https://reviews.apache.org/r/23820/diff/1/?file=639471#file639471line300>
> >
> >     Why was this necessary to change?

Hey, Szehon, Thanks for the review. I think this change is necessary to make 
the counting logic for lock attempt more accurate and cleaner. The previous 
counting logic might have a small bug. For example, if we set 
hive.lock.numretries (The number of times you want to try to get all the locks) 
to 2, it only allows you to make one locking attempt and then loop out if not 
successful. Actually the counting logic used in method unlockWithRetry is right 
and the one used here is same as that. Please let me know if anything I am 
missing here.


- Chaoyu


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23820/#review48441
-----------------------------------------------------------


On July 23, 2014, 2:27 a.m., Chaoyu Tang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23820/
> -----------------------------------------------------------
> 
> (Updated July 23, 2014, 2:27 a.m.)
> 
> 
> Review request for hive, Brock Noland, Prasad Mujumdar, Szehon Ho, and Xuefu 
> Zhang.
> 
> 
> Bugs: HIVE-7445
>     https://issues.apache.org/jira/browse/HIVE-7445
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This patch enables ZookeeperHiveLockManager.java, when in debug mode, to log 
> out information about contentious locks if lockmgr fails to acquire a lock 
> for a query. The changes include:
> 1. Collect and log out contentious lock information in 
> ZookeeperHiveLockManager.java
> 2. Improve lock retry counting and existing logging, and modified some qtests 
> output files to match these logging
>  
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/lockmgr/HiveLockObject.java 1cc3074 
>   
> ql/src/java/org/apache/hadoop/hive/ql/lockmgr/zookeeper/ZooKeeperHiveLockManager.java
>  65b9136 
>   ql/src/test/results/clientnegative/insert_into1.q.out a38b679 
>   ql/src/test/results/clientnegative/insert_into2.q.out f21823a 
>   ql/src/test/results/clientnegative/insert_into3.q.out 5f1581e 
>   ql/src/test/results/clientnegative/insert_into4.q.out 5dcdd50 
>   ql/src/test/results/clientnegative/lockneg1.q.out 6a76cd7 
>   ql/src/test/results/clientnegative/lockneg_try_db_lock_conflict.q.out 
> a9833a8 
>   ql/src/test/results/clientnegative/lockneg_try_drop_locked_db.q.out d67365a 
>   ql/src/test/results/clientnegative/lockneg_try_lock_db_in_use.q.out 89d3265 
> 
> Diff: https://reviews.apache.org/r/23820/diff/
> 
> 
> Testing
> -------
> 
> 1. Manual tests: following debug logging was printed out as expected during a 
> lock acquisition failure.
> ---
> Unable to acquire IMPLICIT, EXCLUSIVE lock default@sample_07 after 2 attempts.
> 14/07/22 11:44:40 ERROR ZooKeeperHiveLockManager: Unable to acquire IMPLICIT, 
> EXCLUSIVE lock default@sample_07 after 2 attempts.
> 14/07/22 11:44:40 DEBUG ZooKeeperHiveLockManager: Requested lock 
> default@sample_07:: mode:IMPLICIT,EXCLUSIVE; query:insert into table 
> sample_07 select * from sample_08
> 14/07/22 11:44:40 DEBUG ZooKeeperHiveLockManager: Conflicting lock to 
> default@sample_07:: mode:IMPLICIT;query:select code from 
> sample_07;queryId:root_20140722084242_98f8d9d7-d110-45c0-8c8b-12da2e5172d9;clientIp:10.20.92.233
> ---
> 
> 2. Precommit tests
> The test failure testCliDriver_ql_rewrite_gbtoidx is a preexisting one and I 
> think it is not related to this change.
> 
> 
> Thanks,
> 
> Chaoyu Tang
> 
>

Reply via email to