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

Alan Gates commented on HIVE-8711:
----------------------------------

bq. 1. TxnHandler.detectDeadlock() - I think it makes sense to implement it 
like getDbTime() so that checks only what is expected for a given DB type. For 
example, if Oracle throws 40001, current code will assume it's a deadlock.
Makes sense, will do.
bq. 2. DeadLockCreator - it seems that it can easily guarantee deadlock by 
calling updateTxns(conn1), updateLocks(conn2), updateLocks(conn1). It could 
then be enabled permanently.
I tried that first, but on both mysql and derby it didn't generate a deadlock.  
It died with a lock timeout, and took over a minute to do so.  With the current 
two thread test both dbs detect the deadlock and throw an exception within a 
few seconds.
bq.3. Nit: why are constants in TxnHandler, such as LOCK_ACQUIRED 'protected' 
They are only used in test code which is the same package as TxnHandler.
Personal preference.  "protected" says to me that this still belongs to this 
class.  With package level I'm never sure if I meant to make it package level 
or just forgot to put a modifier.
4. This not related to this bug, but MetaStoreThread.BooleanPointer() has 
multiple threads reading/writing a boolean variable which is not volatile or 
AtomicBoolean... this looks like a recipe for trouble
We can file a separate JIRA for that.  In practice, it's only written in tests 
and read in production code, so I don't expect to see any issues, but it's best 
to fix it before someone forgets the original intent and writes to it in 
production code.

> DB deadlocks not handled in TxnHandler for Postgres, Oracle, and SQLServer
> --------------------------------------------------------------------------
>
>                 Key: HIVE-8711
>                 URL: https://issues.apache.org/jira/browse/HIVE-8711
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>    Affects Versions: 0.14.0
>            Reporter: Alan Gates
>            Assignee: Alan Gates
>            Priority: Critical
>             Fix For: 0.14.0
>
>         Attachments: HIVE-8711.patch
>
>
> TxnHandler.detectDeadlock has code to catch deadlocks in MySQL and Derby.  
> But it does not detect a deadlock for Postgres, Oracle, or SQLServer



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

Reply via email to