Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Query traversal exception while upgrading to 6.4

Avatar

Adobe Champion

Hi all,

After upgrading our code from 6.1 to 6.4, we are getting below error for one of the query causing impact in functionality.

java.lang.UnsupportedOperationException: The query read or traversed more than 100000 nodes. To avoid affecting other tasks, processing was stopped.

at org.apache.jackrabbit.oak.query.FilterIterators.checkReadLimit(FilterIterators.java:70) [org.apache.jackrabbit.oak-core:1.8.2]

The same query listed below used to work in 6.1, but having issues in 6.4.

String query = SELECT * FROM [cq:PageContent] WHERE ([_____________] IS NOT NULL OR [____________] IS NOT NULL

Iterator<Resource> iterator = adminResourceResolver.findResources(query, Query.JCR_SQL2);

I tried manual oak:index creation as well as increasing In memory read to limit in Query Engine Settings Service OSGI, but it didn't help.

Help or Pointers to fix this in AEM 6.4 will be helpful.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Adobe Champion

Thanks, Ashwin for the reply.

However, I already create oak: index node and also updated Query Engine Settings Service OSGI, but it also didn't help.

Any other specifics or suggestion which worked with 6.4?

View solution in original post

3 Replies

Avatar

Level 1

From 6.3 and above, query will be stopped if it traversing 10000 nodes. You need to write index for it to avoid traversing or update settings (Apache Jackrabbit Query Engine Settings Service). Be careful that if there are more traversal, then it will slow down the system.

More info - Troubleshooting Slow Queries

Avatar

Correct answer by
Adobe Champion

Thanks, Ashwin for the reply.

However, I already create oak: index node and also updated Query Engine Settings Service OSGI, but it also didn't help.

Any other specifics or suggestion which worked with 6.4?

Avatar

Community Advisor

Hi,

There is configuration to increase the query limit

Go to Config Mgr and search for below configuration and you can increase the limit as per your requirement. But it is always good to create indexing to avoid load on the instance.

Apache Jackrabbit Query Engine Settings Service