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

Na Li commented on SENTRY-1902:
-------------------------------

in 
https://github.com/apache/sentry/blob/master/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/DeltaTransactionBlock.java,
 we can see the changeID is manually increased. So if the test has multiple 
threads persisting new perm change with changeID, such exception will happen 
from time to time.

What is the failed test? Does it have multi-thread?

> TestSentryStore causes ID conflicts on MSentryPermChange
> --------------------------------------------------------
>
>                 Key: SENTRY-1902
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1902
>             Project: Sentry
>          Issue Type: Bug
>          Components: Sentry
>    Affects Versions: 2.0.0
>            Reporter: Alexander Kolbasov
>
> I noticed that TestSentryStore shows this in the logs:
> {code}
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: java.sql.BatchUpdateException: The statement was aborted because 
> it would have caused a duplicate key value in a unique or primary key 
> constraint or unique index identified by 'SENTRY_PERM_CHANGE_PK' defined on 
> 'SENTRY_PERM_CHANGE'.
> {code}
> This causes multiple transaction retries. We need to investigate this.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to