[
https://issues.apache.org/jira/browse/OAK-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123711#comment-15123711
]
Tomek Rękawek edited comment on OAK-3924 at 1/29/16 4:36 PM:
-------------------------------------------------------------
I think that in Postgres, if we try to insert two documents with the same ID
concurrently, both operations may fail (and no document is inserted). Therefore
we can't assume that all new documents are inserted after the first round, so
the {{upsert}} should be always set to true. Attached patch
{{OAK\-3924-06-always-upsert.patch}} fixes this.
was (Author: tomek.rekawek):
I think that in Postgres, if we try to insert two documents with the same ID
concurrently, both operations may fail (and no document is inserted). Therefore
we can't assume that all new documents are inserted after the first round, so
the {{upsert}} should be always set to true. Attached patch
{{OAK-3924-06-always-upsert.patch}} fixes this.
> Fix database-level row deadlock during bulk updates in RDB
> ----------------------------------------------------------
>
> Key: OAK-3924
> URL: https://issues.apache.org/jira/browse/OAK-3924
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: rdbmk
> Reporter: Tomek Rękawek
> Assignee: Julian Reschke
> Priority: Critical
> Fix For: 1.3.15
>
> Attachments: OAK-3924-01-disable-property.patch,
> OAK-3924-02-concurrent-tests.patch, OAK-3924-03-autocommit.patch,
> OAK-3924-04-sort-documents.patch,
> OAK-3924-05-handle-batch-update-exception.patch,
> OAK-3924-06-always-upsert.patch, OAK-3924.patch
>
>
> It seems that the new bulk createOrUpdate() implementation in RDB is prone
> for the deadlocks. It isn't a bug in the Oak code, but rather something
> related to the database implementations. The bug can be observed if we have
> multiple simultaneous bulk updates and some of the rows repeat among them.
> The attached patch contains an unit test {{testConcurrentWithConflict}}
> presenting the issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)