jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomek Rękawek (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (OAK-3649) Extract node document cache from Mongo and RDB document stores
Date Tue, 01 Dec 2015 13:08:11 GMT

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

Tomek Rękawek edited comment on OAK-3649 at 12/1/15 1:07 PM:
-------------------------------------------------------------

[~reschke], thanks for the comment. Indeed, it shouldn't be the developer responsibility to
remember whether a method requires a lock or not - it should be somehow enforced. Locks are
reentrant, so maybe we can just acquire a lock every time there's a destructive or complex
operation which should be performed atomically?

I pass the NodeDocumentLocks to the NodeDocumentCache, so now all cache operations are thread-safe.
If the DocumentStore needs synchronize a bigger part of code, it can use the same reentrant
lock stripe.

The side effect is that TreeLock has been re-introduced again into the RDBDocumentStore, but
only the acquire() method is used, so it behaves like a normal lock stripe. I hope you don't
mind this.

Let me know what do you think.


was (Author: tomek.rekawek):
[~reschke], thanks for the comment. Indeed, it shouldn't be the developer responsibility to
remember whether a method requires a lock or not - it should be somehow enforced. Locks are
reentrant, so maybe we can just acquire a lock every time there's a destructive or complex
operation which should be performed atomically?

In the following branch I pass the NodeDocumentLocks to the NodeDocumentCache, so now all
cache operations are thread-safe. If the DocumentStore needs synchronize a bigger part of
code, it can use the same reentrant lock stripe.

The side effect is that TreeLock has been re-introduced again into the RDBDocumentStore, but
only the acquire() method is used, so it behaves like a normal lock stripe. I hope you don't
mind this.

Branch:
https://github.com/trekawek/jackrabbit-oak/tree/OAK-3649-thread-safe

Updated patch:
https://github.com/trekawek/jackrabbit-oak/pull/3.diff

Let me know what do you think.

> Extract node document cache from Mongo and RDB document stores
> --------------------------------------------------------------
>
>                 Key: OAK-3649
>                 URL: https://issues.apache.org/jira/browse/OAK-3649
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: documentmk, mongomk, rdbmk
>            Reporter: Tomek Rękawek
>            Priority: Minor
>              Labels: candidate_oak_1_0, candidate_oak_1_2
>             Fix For: 1.3.12
>
>
> MongoDocumentStore and RDBDocumentStore contains copy & pasted methods responsible
for handling node document cache. Extract these into a new NodeDocumentCache.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message