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

Alex Parvulescu commented on OAK-5229:
--------------------------------------

attaching new version of the patch [^OAK-5229-v3.patch]. 
Based on an offline discussion with [~anchela], I updated the patch again:
 * added a lightweight verification of the provided primary type (very similar 
to what is happening to the mixins) while at the same time full validation of 
the transient space is not covered (validation is still based on the 
commithook).
* revisited changing the primary type to add the missing autocreated properties 
(similar to the mixin situation).
* made adding the same primary type again to a node into a noop.

Benchmarks attached. Even though the patched version is a lot better off, I 
noticed very large variance between subsequent runs of the same bench, so I'm 
not convinced these numbers actually mean anything, but this might merit a 
dedicated discussion.

Unpatched version
{noformat}
# ConcurrentReadWriteTest          C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1      45     107     125     151     264    
 705
# ConcurrentWriteReadTest          C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1       3       6      16      32     141    
5259
# ConcurrentWriteTest              C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1      78      81      85      94     175    
1038
# CreateManyChildNodesTest         C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1     445     455     480     532     581    
 149
# CreateManyNodesTest              C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1     134     138     154     164     196    
 593
# ConcurrentCreateNodesTest        C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1     512     525     552     598     641    
 163
# SequentialCreateNodesTest        C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1     211     222     243     258     336    
 350
{noformat}

Patched version
{noformat}
# ConcurrentReadWriteTest          C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1      40      98     117     139     252    
 761
# ConcurrentWriteReadTest          C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1       3       5      16      30     158    
5524
# ConcurrentWriteTest              C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1      77      80      82      90     154    
1070
# CreateManyChildNodesTest         C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1     471     481     539     567     612    
 138
# CreateManyNodesTest              C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1     144     147     154     171     201    
 577
# ConcurrentCreateNodesTest        C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1     496     506     521     557     605    
 171
# SequentialCreateNodesTest        C     min     10%     50%     90%     max    
   N 
Oak-Segment-Tar                    1     209     214     222     243     271    
 375
{noformat}

[~tripod] does this cover everything?


> Using Node.setPrimaryType() should fail if non-matching childnodes
> ------------------------------------------------------------------
>
>                 Key: OAK-5229
>                 URL: https://issues.apache.org/jira/browse/OAK-5229
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.14
>            Reporter: Tobias Bocanegra
>            Assignee: Alex Parvulescu
>            Priority: Critical
>             Fix For: 1.8, 1.6.1
>
>         Attachments: OAK-5229.patch, OAK-5229-tests.patch, OAK-5229-v2.patch, 
> OAK-5229-v3.patch
>
>
> 1. Assume the following:
> {noformat}
> /testNode [nt:unstructured]
>   /unstructured_child [nt:unstructured]
> {noformat}
> 2. setting "/testNode".setPrimaryType("nt:folder")
> 3. save the session.
> Altering the primary type works, thus leaving the repository in an 
> inconsistent state.
> Interestingly, subsequent calls to 
> "/testNiode/unstructured_child".setProperty() will fail:
> {noformat}
> javax.jcr.nodetype.ConstraintViolationException: OakConstraint0001: 
> /test_node[[nt:folder]]: No matching definition found for child node 
> unstructured_child with effective type [nt:unstructured]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to