Deleting or moving certain folders or assets in AEM via the /assets.html or /damadmin UI is either slow or fails.
If the delete or move operation fails, then in the log file you see this [1] WARN log message, "The query read or traversed more than X nodes."
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:66) at org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy$PathIterator.fetchNextPossiblyDuplicate(ContentMirrorStoreStrategy.java:422) at org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy$PathIterator.fetchNext(ContentMirrorStoreStrategy.java:365) at org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy$PathIterator.next(ContentMirrorStoreStrategy.java:449) at org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy$PathIterator.next(ContentMirrorStoreStrategy.java:303) at com.google.common.collect.Iterators$7.computeNext(Iterators.java:646) at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) at org.apache.jackrabbit.oak.spi.query.Cursors$PathCursor.hasNext(Cursors.java:205) at org.apache.jackrabbit.oak.query.ast.SelectorImpl.next(SelectorImpl.java:407) at org.apache.jackrabbit.oak.query.QueryImpl$RowIterator.fetchNext(QueryImpl.java:773) at org.apache.jackrabbit.oak.query.QueryImpl$RowIterator.hasNext(QueryImpl.java:798) at com.google.common.collect.Iterators$5.hasNext(Iterators.java:542) at org.apache.jackrabbit.oak.query.FilterIterators$DistinctIterator.fetchNext(FilterIterators.java:137) at org.apache.jackrabbit.oak.query.FilterIterators$DistinctIterator.hasNext(FilterIterators.java:151) at org.apache.jackrabbit.oak.jcr.query.QueryResultImpl$3.fetch(QueryResultImpl.java:181) at org.apache.jackrabbit.oak.jcr.query.QueryResultImpl$3.<init>(QueryResultImpl.java:176) at org.apache.jackrabbit.oak.jcr.query.QueryResultImpl.getNodes(QueryResultImpl.java:170) at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.findResources(JcrResourceProvider.java:346) at org.apache.sling.resourceresolver.impl.tree.RootResourceProviderEntry$2.seek(RootResourceProviderEntry.java:148) at org.apache.sling.resourceresolver.impl.tree.RootResourceProviderEntry$2.<init>(RootResourceProviderEntry.java:134) at org.apache.sling.resourceresolver.impl.tree.RootResourceProviderEntry.findResources(RootResourceProviderEntry.java:132) at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.findResources(ResourceResolverImpl.java:694) at com.day.cq.dam.core.impl.AssetReferenceResolverImpl.getReferences(AssetReferenceResolverImpl.java:524) at com.day.cq.wcm.core.impl.commands.DeletePageCommand.performCommand(DeletePageCommand.java:142) at com.day.cq.wcm.core.impl.commands.WCMCommandServlet$CommandHolder.performCommand(WCMCommandServlet.java:161) at com.day.cq.wcm.core.impl.commands.WCMCommandServlet.performCommand(WCMCommandServlet.java:264) at com.day.cq.commons.servlets.AbstractCommandServlet.doPost(AbstractCommandServlet.java:49)
During certain actions in AEM Assets, the system will perform the search below originating from AssetReferenceResolverImpl.getReferences:
//element(*, nt:unstructured)[(jcr:like(@dam:resolvedPath, '/content/dam/geometrixx/services%') or jcr:like(@sling:resource , '/content/dam/geometrixx/services%'))]
When the system has a lot of content then that search doesn't always perform well and could fail with the error above.