[
https://issues.apache.org/jira/browse/OAK-2120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14144598#comment-14144598
]
Michael Dürig commented on OAK-2120:
------------------------------------
+1, makes sense. That code dates back to when we weren't sure how to best
handle this case.
> Simplify BranchStates
> ---------------------
>
> Key: OAK-2120
> URL: https://issues.apache.org/jira/browse/OAK-2120
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Marcel Reutegger
> Assignee: Marcel Reutegger
> Priority: Minor
>
> Transitions between the various BranchStates are documented for each of the
> state classes in AbstractNodeStoreBranch. I'd like to simplify some of the
> states and remove transitions that can be expensive.
> E.g. Persisted.setRoot() may transition to Unmodified if the given root state
> equals the base state. This makes sense, but is unlikely to happen on a real
> life system. At least with the DocumentNodeStore the equals comparison of
> base and root in setRoot() can become rather expensive if there had been many
> branch commits already.
> I propose to remove the transition back to Unmodified. I don't see a
> compelling reason or requirement to perform this check at this stage. The
> branch could simply stay in the Persisted state and leave it up to the
> underlying NodeStore implementation to optimize the case where subsequent
> branch commits 'undo' previous changes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)