jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Zakharov <dmitry.zakharov1...@gmail.com>
Subject Jackrabbit Oak DuplicateKeyException
Date Tue, 12 Mar 2019 19:33:14 GMT
Dear Jackrabbit Developers,

We are planning to migrate current Jackrabbit Oak version used in our
application from 1.4.8 to the latest stable version. At the time we started
evaluation it was 1.8.11.

We have tests that we created for our implementation, some of them perform
concurrent nodes creation. Unfortunately, they fail with 1.8.11 (see
stacktrace bellow). It seems to be some race condition because it does not
happen 100% of the time.
Nodes that are created in parallel have the same content. If we change the
content to be different for each node it runs successfully.
It would be highly appreciated if you could assist us with the issue.

After comparing 1.4.8 and 1.8.11 versions, we discovered that the code at
o.a.j.o.p.d.m.MongoBlobStore.storeBlock (..) has changed under the
following revision

https://svn.apache.org/viewvc?view=revision&revision=1828502
or github
https://github.com/apache/jackrabbit-oak/commit/012e7529a6b8e34836f2fe22bcab3861b9d7192d#diff-1e1cd3443fc4e611259407cdf0ed6ebcL105

in 1.4.8 DuplicateKeyException is ignored. in 1.8.11 you catch any
MongoException and wrap it into IOException.
Amit Jain explained to us that it is not necessary to catch
DuplicateKeyException anymore, because upsert is used.

However, we now get the exception which is propagated to our layer that
does not know anything about mongo exceptions.

we have created a small project that reproduces the issue, however, I have
sent it in the previous email and it was not delivered. I would need
another way of sending it to you.

some additional info:

we use mongo 3.6 for testing 1.8.11 and our current implementation is based
on mongo 3.2

we use mongo-java-driver 3.10.1 driver for 1.8.11 testing, and current
driver version is 3.3.0

how we created db to be used by jackrabbit:
	"C:\Program Files\MongoDB\Server\3.6\bin\mongo.exe" -u admin
--authenticationDatabase admin test --eval
"db.createUser({user:""test"",pwd:""test"",roles:[{role:""readWrite"",db:""test""},{role:""clusterMonitor"",db:""admin""}]})"

stacktrace:

Caused by: java.io.IOException: Write failed with error code 11000 and
error message 'E11000 duplicate key error collection: test.blobs index:
_id_ dup key: { :
"c3d471c99bd0a96030dc0f8b6951021b1333d4bcb11d8c9e16743a5d8a11cc60" }'
    at
org.apache.jackrabbit.oak.plugins.document.mongo.MongoBlobStore.storeBlock(MongoBlobStore.java:103)
~[oak-store-document-1.8.11.jar:1.8.11]
    at
org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.convertBlobToId(AbstractBlobStore.java:386)
~[oak-blob-1.8.11.jar:1.8.11]
    at
org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.writeBlob(AbstractBlobStore.java:195)
~[oak-blob-1.8.11.jar:1.8.11]
    at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.createBlob(DocumentNodeStore.java:1865)
~[oak-store-document-1.8.11.jar:1.8.11]
    at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.createBlob(DocumentNodeStore.java:133)
~[oak-store-document-1.8.11.jar:1.8.11]
    at
org.apache.jackrabbit.oak.core.MutableRoot.createBlob(MutableRoot.java:326)
~[oak-core-1.8.11.jar:1.8.11]
    at
org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl.createBinaryValue(ValueFactoryImpl.java:296)
~[oak-store-spi-1.8.11.jar:1.8.11]
    at
org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl.createBinary(ValueFactoryImpl.java:288)
~[oak-store-spi-1.8.11.jar:1.8.11]
    ... 40 more

If you need any additional information, please do not hesitate to ask.
Once again, any assistance is highly appreciated.

thank you in advance.


-- 
------------------------------------------------------
Best Regards,


Dmitry Zakharov

Mime
View raw message