[ 
https://issues.apache.org/jira/browse/OAK-534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marcel Reutegger updated OAK-534:
---------------------------------

    Attachment: OAK-534.patch

Attached patch introduces a OneLevelDiffCommand, which is used when MK.diff() 
is called with depth = 0. It's a specialized version of DiffCommand, which 
works with the commits collection to find out what the affected paths are in a 
given revision range.

Please note that I also had to fix a test case to get the mongomk tests running 
reliably on my Windows machine, but that's most likely unrelated to this issue.
                
> 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

Reply via email to