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

Thomas Mueller commented on OAK-7910:
-------------------------------------

If I also "fix" the last exception, using the patch below, then storing the 
index definition works, but the index is not built. Trying to reindex fails 
with a different exception:

{noformat}
20.11.2018 12:29:51.448 *WARN* [async-index-update-async] 
org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate [async] The index 
update failed
java.lang.UnsupportedOperationException: This builder is read-only.
        at 
org.apache.jackrabbit.oak.spi.state.ReadOnlyBuilder.unsupported(ReadOnlyBuilder.java:44)
 [org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
        at 
org.apache.jackrabbit.oak.spi.state.ReadOnlyBuilder.remove(ReadOnlyBuilder.java:110)
 [org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
        at 
org.apache.jackrabbit.oak.plugins.index.IndexUpdate.removeIndexState(IndexUpdate.java:321)
        at 
org.apache.jackrabbit.oak.plugins.index.IndexUpdate.collectIndexEditors(IndexUpdate.java:296)
        at 
org.apache.jackrabbit.oak.plugins.index.IndexUpdate.enter(IndexUpdate.java:163)
        at 
org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:53) 
[org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
        at 
org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:48) 
[org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
        at 
org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.updateIndex(AsyncIndexUpdate.java:728)
        at 
org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.runWhenPermitted(AsyncIndexUpdate.java:573)
        at 
org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.run(AsyncIndexUpdate.java:432)
        at 
org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:347)
 [org.apache.sling.commons.scheduler:2.7.2]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) 
[org.apache.sling.commons.scheduler:2.7.2]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)


----- after the following patch --------

Index: src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java     
(revision 1845889)
+++ src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java     
(working copy)
@@ -30,6 +30,7 @@
 import org.apache.jackrabbit.oak.spi.commit.Validator;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -86,6 +87,9 @@
     }
 
     protected void checkValidName(String name) throws CommitFailedException {
+        if (NodeStateUtils.isHidden(name)) {
+            return;
+        }
         int colon = name.indexOf(':');
         if (colon > 0) {
             String prefix = name.substring(0, colon);
{noformat}


> Node type validation of a hidden node
> -------------------------------------
>
>                 Key: OAK-7910
>                 URL: https://issues.apache.org/jira/browse/OAK-7910
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Major
>
> With the composite node store, creating a Lucene index in the read-write 
> repository fails due to the exception below. I think Oak shouldn't try to do 
> node type validation for hidden nodes.
> {noformat}
> Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: 
> OakConstraint0001: /oak:index/test/:oak:mount-libs-index-data[[]]: The 
> primary type null does not exist
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor$1.onConstraintViolation(TypeEditor.java:109)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.constraintViolation(TypeEditor.java:234)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.createEffectiveType(TypeEditor.java:337)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.<init>(TypeEditor.java:203)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.checkNodeTypeConstraints(TypeEditor.java:482)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.enter(TypeEditor.java:276)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:53)
>  [org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.spi.commit.CompositeEditor.enter(CompositeEditor.java:65)
>  [org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:121)
>  [org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.composite.CompositeNodeState$WrappingDiff.childNodeAdded(CompositeNodeState.java:304)
>  [org.apache.jackrabbit.oak-store-composite:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.composite.CompositeNodeState$ChildrenDiffFilter.childNodeAdded(CompositeNodeState.java:247)
>  [org.apache.jackrabbit.oak-store-composite:1.9.10.R1845889]
> Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: 
> OakConstraint0001: /oak:index/test/:oak:mount-libs-index-data[[]]: The 
> primary type null does not exist
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor$1.onConstraintViolation(TypeEditor.java:109)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.constraintViolation(TypeEditor.java:234)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.createEffectiveType(TypeEditor.java:337)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.<init>(TypeEditor.java:203)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.checkNodeTypeConstraints(TypeEditor.java:482)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.enter(TypeEditor.java:276)
>  [org.apache.jackrabbit.oak-core:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:53)
>  [org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.spi.commit.CompositeEditor.enter(CompositeEditor.java:65)
>  [org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:121)
>  [org.apache.jackrabbit.oak-store-spi:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.composite.CompositeNodeState$WrappingDiff.childNodeAdded(CompositeNodeState.java:304)
>  [org.apache.jackrabbit.oak-store-composite:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.composite.CompositeNodeState$ChildrenDiffFilter.childNodeAdded(CompositeNodeState.java:247)
>  [org.apache.jackrabbit.oak-store-composite:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.segment.MapRecord$4.childNodeAdded(MapRecord.java:443)
>  [org.apache.jackrabbit.oak-segment-tar:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:505) 
> [org.apache.jackrabbit.oak-segment-tar:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:440) 
> [org.apache.jackrabbit.oak-segment-tar:1.9.10.R1845889]
>       at 
> org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:651)
>  [org.apache.jackrabbit.oak-segment-tar:1.9.10.R1845889]
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to