[ https://issues.apache.org/jira/browse/OAK-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14100677#comment-14100677 ]
Marcel Reutegger commented on OAK-2020: --------------------------------------- In http://svn.apache.org/r1618613 I fixed the equals() method and enabled the tests. Previously the method would return false when the lastRevisions of two states were different. Now it only returns true when the lastRevisions are equal (or the sub tree did not change between the two revisions). Please note that I also slightly changed the comparison of the lastRevision. The DocumentNodeState now first compares the (read) revision and then the lastRevision. DocumentNodeStates are considered equal if either of them is equal. As can be seen in the test, it may happen that a DocumentNodeState is read multiple times with the same read revision, but the lastRev may be different. This is as designed, when the some node below that node is modified and the current (most recent) lastRev becomes more recent than the read revision. With this change some invocations of DocumentNodeState.equals() may be more expensive than before. While the method previously just returned false pretty quickly when the lastRevision differed for two DocumentNodeState, the method will now traverse down the tree until it finds the node where the lastRevision is equal or less the read revision. In most cases this is quite isolated in the hierarchy, e.g. when there are concurrent changes and a rebase is needed. Comparing the benchmark numbers of write tests before and after the change did not show significant changes in timing. > NodeState view at given version is not stable with DocumentNodeStore > -------------------------------------------------------------------- > > Key: OAK-2020 > URL: https://issues.apache.org/jira/browse/OAK-2020 > Project: Jackrabbit Oak > Issue Type: Bug > Components: mongomk > Reporter: Chetan Mehrotra > Assignee: Marcel Reutegger > Fix For: 1.1 > > > DocumentNodeStore should provide same NodeState for given (path, revision) > whenever a NodeState is obtained from it. This fails in some cases if the > Node cache in DocumentNodeStore gets overflown and then the NodeState > returned differs. This causes issues like > # Spurious Commits see - Some commit would fails with conflicts in paths > which were not modified in that commit > # Diff logic would traverse those paths which are not related to changes done > in that commit > More details would be provided in comments below -- This message was sent by Atlassian JIRA (v6.2#6252)