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

Marcel Reutegger updated OAK-4697:
----------------------------------
    Labels: observation performance  (was: )

> Optimize read of old node state
> -------------------------------
>
>                 Key: OAK-4697
>                 URL: https://issues.apache.org/jira/browse/OAK-4697
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core, documentmk
>            Reporter: Marcel Reutegger
>            Assignee: Marcel Reutegger
>              Labels: observation, performance
>             Fix For: 1.6
>
>
> Reading a node state with an old revision from a document can be expensive 
> when many changes happened on a property in the meantime.
> A typical stack trace looks like this:
> {noformat}
>       at 
> org.apache.jackrabbit.oak.plugins.document.NodeDocument.getPreviousDocument(NodeDocument.java:1337)
>       at 
> org.apache.jackrabbit.oak.plugins.document.PropertyHistory$1.apply(PropertyHistory.java:70)
>       at 
> org.apache.jackrabbit.oak.plugins.document.PropertyHistory$1.apply(PropertyHistory.java:63)
>       at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
>       at 
> com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
>       at com.google.common.collect.Iterators$7.computeNext(Iterators.java:646)
>       at 
> com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
>       at 
> com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
>       at 
> com.google.common.collect.Iterators$PeekingImpl.hasNext(Iterators.java:1139)
>       at 
> org.apache.jackrabbit.oak.plugins.document.PropertyHistory$2.refillQueue(PropertyHistory.java:121)
>       at 
> org.apache.jackrabbit.oak.plugins.document.PropertyHistory$2.computeNext(PropertyHistory.java:96)
>       at 
> org.apache.jackrabbit.oak.plugins.document.PropertyHistory$2.computeNext(PropertyHistory.java:88)
>       at 
> com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
>       at 
> com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
>       at 
> org.apache.jackrabbit.oak.plugins.document.ValueMap$1$3.nextIterator(ValueMap.java:105)
>       at 
> org.apache.jackrabbit.oak.plugins.document.util.MergeSortedIterators.fetchNextIterator(MergeSortedIterators.java:98)
>       at 
> org.apache.jackrabbit.oak.plugins.document.util.MergeSortedIterators.next(MergeSortedIterators.java:85)
>       at 
> com.google.common.collect.Iterators$PeekingImpl.peek(Iterators.java:1162)
>       at 
> org.apache.jackrabbit.oak.plugins.document.util.MergeSortedIterators.adjustFirst(MergeSortedIterators.java:117)
>       at 
> org.apache.jackrabbit.oak.plugins.document.util.MergeSortedIterators.next(MergeSortedIterators.java:78)
>       at 
> org.apache.jackrabbit.oak.plugins.document.NodeDocument.getLatestValue(NodeDocument.java:1972)
>       at 
> org.apache.jackrabbit.oak.plugins.document.NodeDocument.getNodeAtRevision(NodeDocument.java:990)
>       at 
> org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.readNode(DocumentNodeStore.java:1079)
> {noformat}
> The read operation goes through the property history until it finds the most 
> recent change. The old the read revision, the more changes are scanned.



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

Reply via email to