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

Lei (Eddy) Xu commented on SENTRY-1643:
---------------------------------------

I believe that this is a concurrency issue when do the parallel perm/path 
changes insertions in large transactions. 

It is similar to this: 
http://stackoverflow.com/questions/1716515/mysql-autoincrement-column-increases-by-10-problem.
 

It'd be difficult for a ORM to make the primary keys strictly consecutive.  
[~hahao], [~akolb] is there a reason that requires the change ID be 
consecutive? Would monotone increasing change IDs become sufficient? I do feel 
that not relying consecutive values can be more robust.

> AutoIncrement ChangeID of MSentryPermChange/MSentryPathChange may be 
> error-prone
> --------------------------------------------------------------------------------
>
>                 Key: SENTRY-1643
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1643
>             Project: Sentry
>          Issue Type: Sub-task
>          Components: Hdfs Plugin
>    Affects Versions: sentry-ha-redesign
>            Reporter: Hao Hao
>            Assignee: Lei (Eddy) Xu
>            Priority: Critical
>             Fix For: sentry-ha-redesign
>
>
> In MSentryPermChange/MSentryPathChange table, the changeID field is 
> auto-increment. 
> {noformat}
> <field name="changeID" primary-key="true" value-strategy="increment">
>   <column name="CHANGE_ID" jdbc-type="BIGINT" allows-null="false"/>
> </field>{noformat}
> However, found through the integration unit test TestHDFSIntegration, the 
> value does not seem to be correctly auto increased. e.g Instead of increasing 
> by one for each new entry, it increased by some unexpected number.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to