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/01/21 17:40:12 UTC

[jira] [Commented] (OAK-534) Inefficient NodeState comparison with MongoMK

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

Marcel Reutegger commented on OAK-534:
--------------------------------------

I now encountered the 'many child nodes' issue raised by Thomas. My Oak repository on MongoMK has
an index on jcr:uuid and contains roughly 7000 referenceable nodes. When a referenceable nodes
is added, the NodeState comparison now triggers diff calls for each of the index entries even
though only one of them was added. This is because the simple implementation I added does not
leverage the child node change information provided by the diff, but instead performs a diff
on each of the index entry nodes.
                
> Inefficient NodeState comparison with MongoMK
> ---------------------------------------------
>
>                 Key: OAK-534
>                 URL: https://issues.apache.org/jira/browse/OAK-534
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, mongomk
>    Affects Versions: 0.5
>            Reporter: Marcel Reutegger
>         Attachments: OAK-534.patch
>
>
> Oak on MongoMK currently results in complete tree traversal for any kind of modification. This is caused by the fact that MongoMK does not support the optional :hash system property. In this case KernelNodeState.compareAgainstBaseState() falls back to a generic implementation, which traverses the complete tree to find out if a subtree was modified.
> The NodeState comparison is triggered in almost all commit hook and validator implementations to find out what changed with the given commit.
> I see a number of options to solve this:
> 1) Add support for :hash system property in MongoMK
> 2) Use MK.diff() to find out if something was modified in a subtree
> 3) Use MK.getJournal() to find out if something was modified in a subtree
> Some initial thoughts on presented options to start the discussion (feel free to jump in and add more):
> Adding the :hash system property in MongoMK might not be that easy, because the implementation tries to avoid contention on the root node by not updating it with every commit. It only updates the nodes that actually changed. A straight forward implementation of :hash requires updating all ancestors of modified nodes.
> Option 2) seems to require additional work in MongoMK because the diff() implementation in MongoMK is using oak-mk DiffBuilder. The builder in turn will then call SimpleMongoNodeStore.compare(), which seems to use the same generic comparison implementation as the fallback in KernelNodeState.compareAgainstBaseState().
> AFAICS 3) might be a viable option with the recent support for branches in getJournal() (OAK-501). But I don't know how efficient this is implemented in MongoMK.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira