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

Dani Rey commented on OAK-3595:
-------------------------------

[~chetanm] I think this should be reopened and fixed for the following reasons.

I think the behavior is neither fail fast nor consistent.

If it would be fail fast, it would fail during creation of the index 
definition. Of course this is not possible, because indexes get created via 
repository operation, not via a specialized GUI which might produce errors. 
Therefore the fail is delayed to the next startup. This is unexpected and 
problematic. Servers either get restarted very rarely (during migrations) or 
automatically (offline segmentstore revision cleanup). In both cases a failing 
startup is a nightmare.

I consider the behavior inconsistent, because the misconfiguration is savely 
ignored during creation, but prevents repository to register upon restart. 
Savely ignoring it during restart would be consistent.

To assert index definition quality I suggest to create an according 
SlingHealthCheck.

> Repository fails to start after definition of lucene property index with 
> nullCheckEnabled on nt:base
> ----------------------------------------------------------------------------------------------------
>
>                 Key: OAK-3595
>                 URL: https://issues.apache.org/jira/browse/OAK-3595
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene
>    Affects Versions: 1.2.4
>            Reporter: Tom Blackford
>            Assignee: Chetan Mehrotra
>            Priority: Minor
>
> * Set up a Lucene property index beneath /oak:index node on the ‘nt:base’ 
> node type.
> * Add a property index for 'testProp'
> * On the property index definition, set the following properties:
> ** analyzed (Boolean) : true
> ** isRegexp (Boolean) : true
> ** name (String) : testProp
> ** nodeScopeIndex (Boolean) : true
> ** nullCheckEnabled (Boolean) : true
> ** propertyIndex (Boolean) : true
> ** useInExcerpt (Boolean) : true
> * The following exception will start appearing in the logs:
> {code}
> 05.11.2015 16:52:23.524 *ERROR* [pool-7-thread-1] 
> org.apache.sling.commons.scheduler.impl.QuartzScheduler Exception during job 
> execution of 
> org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate@6540caf4 : 
> nullCheckEnabled can be set to true for property definition using regular 
> expression
> java.lang.IllegalStateException: nullCheckEnabled can be set to true for 
> property definition using regular expression
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.PropertyDefinition.validate(PropertyDefinition.java:200)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.PropertyDefinition.<init>(PropertyDefinition.java:125)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition$IndexingRule.collectPropConfigs(IndexDefinition.java:830)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition$IndexingRule.<init>(IndexDefinition.java:650)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition.collectIndexRules(IndexDefinition.java:555)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition.<init>(IndexDefinition.java:240)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition.<init>(IndexDefinition.java:217)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.<init>(LuceneIndexEditorContext.java:143)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.<init>(LuceneIndexEditor.java:134)
> at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider.getIndexEditor(LuceneIndexEditorProvider.java:63)
> at 
> org.apache.jackrabbit.oak.plugins.index.CompositeIndexEditorProvider.getIndexEditor(CompositeIndexEditorProvider.java:74)
> at 
> org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardIndexEditorProvider.getIndexEditor(WhiteboardIndexEditorProvider.java:52)
> at 
> org.apache.jackrabbit.oak.plugins.index.IndexUpdate.collectIndexEditors(IndexUpdate.ja
> {code}
> * Stop and Restart the repository
> ** The repository will fail to start with the following exception
> {code}
> [org.apache.jackrabbit.oak.api.jmx.RepositoryManagementMBean]] ServiceEvent 
> REGISTERED
> 05.11.2015 16:48:28.238 *ERROR* [FelixStartLevel] 
> com.adobe.granite.repository.impl.SlingRepositoryManager start: Uncaught 
> Throwable trying to access Repository, calling stopRepository()
> java.lang.IllegalMonitorStateException: attempt to unlock read lock, not 
> locked by current thread
> at 
> java.util.concurrent.locks.ReentrantReadWriteLock$Sync.unmatchedUnlockException(ReentrantReadWriteLock.java:444)
> at 
> java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:428)
> at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1341)
> at 
> java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:881)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to