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

Marcel Reutegger commented on OAK-2562:
---------------------------------------

Implemented a fix in trunk: http://svn.apache.org/r1663705

The read revision of nodes passed to the NodeStateDiff is now controlled by the 
DocumentNodeStore.compare() method. If it finds a corresponding diff, the read 
revision of the child nodes will not be changed to the lastModified revision of 
the parent. This guarantees a better hit rate on the diffCache, because the the 
diff on the child state will again match existing entries in the diffCache.

All tests pass, but this change needs more performance tests to verify the fix.

> DiffCache is inefficient
> ------------------------
>
>                 Key: OAK-2562
>                 URL: https://issues.apache.org/jira/browse/OAK-2562
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, mongomk
>    Affects Versions: 1.0
>            Reporter: Marcel Reutegger
>            Assignee: Marcel Reutegger
>             Fix For: 1.1.8, 1.0.13
>
>
> The diffCache in DocumentNodeStore can be quite inefficient in some cases. It 
> may become ineffective even for rather recent commits.
> The diffCache contains entries for changes of a commit. E.g. it may have an 
> entry that says between revision r7-0-1 and r8-0-1 the following happened 
> under /foo: 'bar' was modified, 'baz' was added, etc. The problem now is, 
> that the revision range in the diffCache refers to the revision of the commit 
> and its base version, whereas on runtime, the diff calls may likely happen 
> for other revision ranges. The further down the tree the node state 
> comparison happens, the more likely it is that the base state has a different 
> revision than the entry in the cache. The DocumentNodeStore attempts to 
> 'link' node states back in time to avoid reading the complete tree at a 
> different revision after each commit.



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

Reply via email to