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

Gopal V commented on HIVE-19369:
--------------------------------

Yes, despite the big description above - that new lock is 90% of this JIRA 
adds, rest of this is just documentation 

Here's the current LockType

  SHARED_READ(1),
  SHARED_WRITE(2),
  EXCLUSIVE(3);

We already have 3 of the above asks, just needs to add a new one (the one which 
you mentioned) 

SHARED_READ
SHARED_WRITE
EXCLUSIVE | EXCL_DROP
+ EXCL_WRITE 

And the only other behaviour change when EXCLUSIVE gets more granularity is 
that the EXCL_DROP is no-wait for the readers, while current EXCLUSIVE is a 
wait for the readers as well.

> Locks: Add new lock implementations for always zero-wait readers
> ----------------------------------------------------------------
>
>                 Key: HIVE-19369
>                 URL: https://issues.apache.org/jira/browse/HIVE-19369
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Gopal V
>            Priority: Major
>
> Hive Locking with Micro-managed and full-ACID tables needs a better locking 
> implementation which allows for no-wait readers always.
> EXCL_DROP
> EXCL_WRITE
> SHARED_WRITE
> SHARED_READ
> Short write-up
> EXCL_DROP is a "drop partition" or "drop table" and waits for all others to 
> exit
> EXCL_WRITE excludes all writes and will wait for all existing SHARED_WRITE to 
> exit.
> SHARED_WRITE allows all SHARED_WRITES to go through, but will wait for an 
> EXCL_WRITE & EXCL_DROP (waiting so that you can do drop + insert in different 
> threads).
> SHARED_READ does not wait for any lock - it fails fast for a pending 
> EXCL_DROP, because even if there is an EXCL_WRITE or SHARED_WRITE pending, 
> there's no semantic reason to wait for them to succeed before going ahead 
> with a SHARED_WRITE.
> a select * => SHARED_READ
> an insert into => SHARED_WRITE
> an insert overwrite or MERGE => EXCL_WRITE
> a drop table => EXCL_DROP
> TODO:
> The fate of the compactor needs to be added to this before it is a complete 
> description.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to