[ https://issues.apache.org/jira/browse/OAK-3937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125371#comment-15125371 ]
Tomek Rękawek edited comment on OAK-3937 at 1/31/16 9:14 PM: ------------------------------------------------------------- My observation is that on the PostgreSQL, if we have a bulk INSERT and there's a conflict, the {{BatchUpdateException#getUpdateCounts}} will return a positive update count even for rows that haven't been successfully created. Method {{RDBOddity#batchFailingInsertResult()}} in the attached [^rdb-oddity.patch] demonstrates this behaviour. [^OAK-3937.patch] fixes this issue by ignoring the {{BatchUpdateException}} exception on PostgreSQL. was (Author: tomek.rekawek): My observation is that on the PostgreSQL, if we have a bulk INSERT and there's a conflict, the {{BatchUpdateException#getUpdateCounts}} returns positive update count even for rows that haven't been successfully created. Method {{RDBOddity#batchFailingInsertResult()}} in attached [^rdb-oddity.patch] demonstrates this behaviour. [^OAK-3937.patch] fixes this issue by ignoring the {{BatchUpdateException}} exception on PostgreSQL. > Batch createOrUpdate() may fail with primary key violation > ---------------------------------------------------------- > > Key: OAK-3937 > URL: https://issues.apache.org/jira/browse/OAK-3937 > Project: Jackrabbit Oak > Issue Type: Technical task > Components: core, rdbmk > Reporter: Marcel Reutegger > Fix For: 1.4 > > Attachments: OAK-3937.patch, rdb-oddity.patch > > > In some cases the batch createOrUpdate() method may fail on RDBMK with a > primary key violation exception. > {noformat} > java.lang.AssertionError: > org.apache.jackrabbit.oak.plugins.document.DocumentStoreException: > org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: > "PRIMARY_KEY_1 ON PUBLIC.DSTEST_NODES(ID) VALUES ('1:/node-40', 118)"; SQL > statement: > insert into dstest_NODES(ID, MODIFIED, HASBINARY, DELETEDONCE, MODCOUNT, > CMODCOUNT, DSIZE, DATA, BDATA) values (?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-185] > {noformat} > See the currently disabled test > {{MultiDocumentStoreTest.concurrentBatchUpdate()}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)