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

Thomas Mueller commented on SLING-8407:
---------------------------------------

> It seems Oak is not ready without the index as queries can't be executed.

Let's put it that way: queries _should_ not be executed if no index is 
available. Right now, they are executed, it's just that in this case a warning 
is logged by Oak. There are multiple reasons an index is not available:

* (A) during the very first startup, the index isn't ready yet
* (B) if the index is corrupt or is not available (for remote indexes)
* (C) if the index was removed or disabled (usually due to user error)

> So we should probably block everything until the index is there.

Block everything, in my view, is the wrong solution. That would mean no part of 
the system would work (or could start up) just because one index is not 
available / available yet.

The solution I propose is to fail exactly that part of the system that needs 
the index. In this case, it affects the health check.

> JobManagerImpl.findJobs should prevent traversal
> ------------------------------------------------
>
>                 Key: SLING-8407
>                 URL: https://issues.apache.org/jira/browse/SLING-8407
>             Project: Sling
>          Issue Type: Improvement
>          Components: Event
>            Reporter: Thomas Mueller
>            Priority: Major
>
> The method 
> [JobManagerImpl.findJobs|https://github.com/apache/sling-org-apache-sling-event/blob/master/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java#L373]
>  runs a JCR query to find all jobs for a topic.
> It is possible that such a query is running while the repository isn't 
> initialized yet, meaning while the index isn't available yet. What is 
> happening in this case is that the query is traversing all nodes below that 
> path, triggering a warning that the query doesn't use an index. It is 
> sometimes happening when a health check is running before the repository is 
> initialized (ReplicationQueueHealthCheck and DistributionQueueHealthCheck).
> It doesn't make sense that the query traverses the nodes. It should use an 
> index. If the index isn't available yet, it should fail. Therefore, the query 
> should use "option(traversal fail)". That would result in an exception that 
> can be caught.  I will log a related issue to change the health checks to 
> process this exception and return HEALTH_CHECK_ERROR for this case.



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

Reply via email to