You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2013/10/10 12:15:41 UTC
[jira] [Commented] (OAK-1088) Thread safe MongoDocumentStore
[ https://issues.apache.org/jira/browse/OAK-1088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13791364#comment-13791364 ]
Marcel Reutegger commented on OAK-1088:
---------------------------------------
Added a test in http://svn.apache.org/r1530908 that illustrates the problem. The first test will likely pass, but the second test with the loop will fail after a while. If it doesn't just, increase the run time.
> Thread safe MongoDocumentStore
> ------------------------------
>
> Key: OAK-1088
> URL: https://issues.apache.org/jira/browse/OAK-1088
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: core, mongomk
> Affects Versions: 0.10
> Reporter: Marcel Reutegger
> Assignee: Marcel Reutegger
>
> In addition to relaxing synchronization in MongoMK we also need to look at thread safety in {{MongoDocumentStore}}. AFAICS MemoryDocumentStore is thread-safe and access to the store is consistent. This is currently not the case for {{MongoDocumentStore}}. The main problem is maintaining the document cache in {{MongoDocumentStore}}. Access to the cache is not coordinated between multiple threads. I avoided the term synchronized, because the actual cache implementation is thread-safe. What needs to be fixed is how {{MongoDocumentStore}} interacts with the cache. E.g. {{findAndModify()}} sends the update to MongoDB, gets the old document back, applies the updates to the old document and then puts it into the cache. If this happens concurrently with multiple threads it may happen that these operations overlap and a thread puts an outdated document into the cache.
--
This message was sent by Atlassian JIRA
(v6.1#6144)