Marcel Reutegger created OAK-1088:
-------------------------------------

             Summary: 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)

Reply via email to