jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig (JIRA) <j...@apache.org>
Subject [jira] [Commented] (OAK-1909) addNode throws InvalidItemStateException instead of ItemExistsException
Date Tue, 24 Jun 2014 07:54:24 GMT

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

Michael Dürig commented on OAK-1909:
------------------------------------

Relaying Marcel's reply from a private discussion:

{quote}
MongoMK does not implement the full
merge logic. What is actually missing is the conflict annotation
on a node store level rebase and automatic merging of concurrently
added nodes when no conflicts are involved.

a node store level rebase shouldn¹t happen in your case, because
you only add a single node. the in memory rebase should kick in
and I¹m not sure if that code already performs the automatic
merging of concurrently added nodes. but even if it does, there is
still a chance that you run into a IISE.

changes from a cluster node are not immediately visible to other
cluster nodes, but may still result in an IISE. this is specific
to MongoMK. any update is eventually checked for conflicts on the
MongoDB level even if the data is not yet visible to the current
cluster node and session.

does the retry after an IISE work? I¹d expect it to fail as well
depending on the timing when the other addNode() becomes visible.
{quote}

> addNode throws InvalidItemStateException instead of ItemExistsException
> -----------------------------------------------------------------------
>
>                 Key: OAK-1909
>                 URL: https://issues.apache.org/jira/browse/OAK-1909
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: mongomk
>            Reporter: Laurie byrum
>
> We are doing some testing with active-active on mongomk. We have some code that creates
a node and the same node can be created by multiple instances/threads/whatever. The node will
look exactly the same regardless of who creates it, and we don't care who creates it, we just
want it to exist. On mongomk, if 2 threads create the same node, we get an InvalidItemStateException.
I would have expected an ItemExistsException, based on 
> http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html?is-external=true
> To repro, run this code in 2 threads:
>                try {
>                  retBucketNode = root.addNode(name, nodeType);
> // Save the newly created bucket
>                  session.save();
>                 } catch (final ItemExistsException e) { …handle the
> failure via session.refresh(false)…}
> Note that you get an InvalidItemStateException instead of the expected ItemExistsException.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message