[ 
https://issues.apache.org/jira/browse/HIVE-24463?focusedWorklogId=551364&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-551364
 ]

ASF GitHub Bot logged work on HIVE-24463:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Feb/21 16:07
            Start Date: 11/Feb/21 16:07
    Worklog Time Spent: 10m 
      Work Description: jkovacs-hwx commented on pull request #1727:
URL: https://github.com/apache/hive/pull/1727#issuecomment-777605722


   I'm not sure if LAST_INSERT_ID() usage here is a good idea. It's not only 
non deterministic in some cases but also does not return the highest value for 
next_val value in other cases:
   - for batched value generation it returns the first value of the batch which 
is the smallest value not the highest one which would be needed for next_val
   - for rolled back sessions it does not return the highest value related the 
last successful value generated
   
   If these happen internally or by any maintenance work on the notifications, 
the next_val can get broken.
   While it's more elegant to use the DB Engine's solution, this function - 
last_insert_id() - does not fit for the logic required here.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 551364)
    Time Spent: 40m  (was: 0.5h)

> Add special case for Derby and MySQL in Get Next ID DbNotificationListener
> --------------------------------------------------------------------------
>
>                 Key: HIVE-24463
>                 URL: https://issues.apache.org/jira/browse/HIVE-24463
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> * Derby does not support {{SELECT FOR UPDATE}} statements
>  * MySQL can be optimized to use {{LAST_INSERT_ID()}}
>  
> Debry tables are locked in other parts of the code already, but not in this 
> path.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to