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

Michael Dürig commented on OAK-638:
-----------------------------------

I didn't have the time yet to look at the patch in full detail but there seem 
to be two issues:

1. Setting {{head}} to {{newRoot}} in {{setRoot()}}: shouldn't this only happen 
when {{persistTransientHead()}} is *not* executed? Otherwise when 
{{MicroKernel.commit()}} fails, the branch might end up in an inconsistent 
state.

2. As it stands the patch does not improve anything since {{RootImpl.commit()}} 
always rebases branches first. This will lead to the branch being persisted in 
any case rendering this optimisation void. To address this, 
{{RootImpl.commit()}} should not rebase commits that do not result in persisted 
branches. Rather should the underlying Microkernel implementation take care of 
this. In order for that to work, we need to ensure that branch followed by 
rebase followed by merge always results in the same result as a commit of the 
same changes. See the discussion around [Conflict handling through rebasing 
branches | http://markmail.org/message/wtaarmdtgyf5lvjt] for some background. 

                
> Avoid branch/merge for small commits
> ------------------------------------
>
>                 Key: OAK-638
>                 URL: https://issues.apache.org/jira/browse/OAK-638
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>         Attachments: OAK-638.patch
>
>
> The branch/merge features on the MicroKernel were initially introduced to 
> stage changes of large commits. Currently oak-core creates a branch even for 
> small changes like updating a property. I think this introduces quite some 
> overhead for scenarios with highly concurrent updates. E.g. think of a 
> twitter like application or a forum with comments. Well, basically user 
> generated content. These update tend to be rather small (couple of nodes) but 
> frequent and concurrent.
> Right now oak-core always does:
> - MK.branch()
> - MK.commit() to branch
> - MK.merge()
> For small commits, it ideally should do:
> - MK.commit() to trunk

--
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