reschke commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2786185614
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java:
##########
@@ -1285,6 +1285,37 @@ public void verifyNotPotentiallySlow() {
}
}
}
+
+ private String createTraversalWarningMessage(Traversal traversal) {
+ String caller =
IndexUtils.getCaller(settings.getIgnoredClassNamesInCallTrace());
+ String message = "Traversal query (query without index): " + statement
+ "; called by " + caller + "; consider creating an index";
+ if (traversal == Traversal.FAIL || traversal == Traversal.WARN &&
!potentiallySlowTraversalQueryLogged) {
+ Set<String> reindex = getNamesOfReindexingIndexes();
+ message += "\n\nExecution plan:\n" + getPlan();
+ if (!reindex.isEmpty()) {
+ String reindexNames = reindex.stream().map(name -> name +
",").collect(Collectors.joining());
+ message += "\n\nNote that the following indexes were
unavailable because of re-indexing:\n"
+ + reindexNames.substring(0, reindexNames.length() - 1);
+ }
Review Comment:
> So I probably would not add this here... instead, I think we should
probably add a metric for "indexes that are currently reindexing", which should
in theory be zero.
Yes, absolutely (separate ticket?)
>And if there are indexes that are indexing, specially if that's for longer
than eg. 1 hour, then we should investigate that.
But that's "just" an operational issue, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]