You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "mbaedke (via GitHub)" <gi...@apache.org> on 2025/11/26 15:20:16 UTC
[PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
mbaedke opened a new pull request, #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626
(no comment)
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#issuecomment-3921674549
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [87.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626)
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#issuecomment-3710491266
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [89.4% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626)
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#issuecomment-3586980916
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626) **Quality Gate failed**
Failed conditions
 [77.8% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_coverage&view=list) (required ≥ 80%)
 [D Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626) (required ≥ A)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2605345620
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java:
##########
@@ -1267,6 +1273,26 @@ public void verifyNotPotentiallySlow() {
}
String caller = IndexUtils.getCaller(settings.getIgnoredClassNamesInCallTrace());
String message = "Traversal query (query without index): " + statement + "; called by " + caller + "; consider creating an index";
Review Comment:
would indeed be nice to refactor this slightly
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke merged PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "thomasmueller (via GitHub)" <gi...@apache.org>.
thomasmueller commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2773972299
##########
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:
Even if the indexes are reindexing currently, I think the old version can still be used for queries (no?)
##########
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. And if there are indexes that are indexing, specially if that's for longer than eg. 1 hour, then we should investigate that.
##########
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);
+ }
+ }
+ return message;
+ }
+
+ private Set<String> getNamesOfReindexingIndexes() {
+ Set<String> reindex = new HashSet<>();
+ Iterable<Tree> indexes = context.getRoot().getTree("/" + INDEX_DEFINITIONS_NAME).getChildren();
+ for (Tree index : indexes) {
+ String name = index.getName();
+ PropertyState primaryType = index.getProperty(JCR_PRIMARYTYPE);
+ if (primaryType != null && INDEX_DEFINITIONS_NODE_TYPE.equals(primaryType.getValue(Type.STRING))) {
+ PropertyState reindexProp = index.getProperty(REINDEX_PROPERTY_NAME);
+ if (reindexProp != null && reindexProp.getValue(Type.BOOLEAN)) {
+ reindex.add(name);
+ }
Review Comment:
I saw some cases where an index had reindex = true, but type = disabled... So that would need to be ignored.
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "thomasmueller (via GitHub)" <gi...@apache.org>.
thomasmueller commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2816315974
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java:
##########
@@ -1285,6 +1292,38 @@ 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 re-indexing at query time:\n"
+ + reindexNames.substring(0, reindexNames.length() - 1);
+ }
+ }
+ return message;
+ }
+
+ private Set<String> getNamesOfReindexingIndexes() {
+ Set<String> reindex = new HashSet<>();
+ Iterable<Tree> indexes = context.getRoot().getTree("/" + INDEX_DEFINITIONS_NAME).getChildren();
+ for (Tree index : indexes) {
+ String name = index.getName();
+ PropertyState primaryType = index.getProperty(JCR_PRIMARYTYPE);
+ if (primaryType != null && INDEX_DEFINITIONS_NODE_TYPE.equals(primaryType.getValue(Type.STRING))) {
+ PropertyState reindexProp = index.getProperty(REINDEX_PROPERTY_NAME);
+ PropertyState typeProp = index.getProperty(TYPE_PROPERTY_NAME);
+ if (reindexProp != null && reindexProp.getValue(Type.BOOLEAN) && !(typeProp != null && TYPE_DISABLED.equals(typeProp.getValue(Type.STRING)))) {
Review Comment:
sorry I have a hard time understanding the "not not" part here:
!(typeProp != null && TYPE_DISABLED.equals(typeProp.getValue(Type.STRING))
what about:
```suggestion
if (reindexProp != null && reindexProp.getValue(Type.BOOLEAN) && typeProp != null && !TYPE_DISABLED.equals(typeProp.getValue(Type.STRING))) {
```
it changes the logic of typeProp == null... normally, it is never null (the node type disallows that) but it's now only there to protect against NPE.
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2812498335
##########
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:
I just made the message more generic.
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "thomasmueller (via GitHub)" <gi...@apache.org>.
thomasmueller commented on PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#issuecomment-3860265429
I think it's a very good improvement, thanks a lot! Just a few minor points / points for discussion.
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2816546890
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java:
##########
@@ -1285,6 +1292,38 @@ 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 re-indexing at query time:\n"
+ + reindexNames.substring(0, reindexNames.length() - 1);
+ }
+ }
+ return message;
+ }
+
+ private Set<String> getNamesOfReindexingIndexes() {
+ Set<String> reindex = new HashSet<>();
+ Iterable<Tree> indexes = context.getRoot().getTree("/" + INDEX_DEFINITIONS_NAME).getChildren();
+ for (Tree index : indexes) {
+ String name = index.getName();
+ PropertyState primaryType = index.getProperty(JCR_PRIMARYTYPE);
+ if (primaryType != null && INDEX_DEFINITIONS_NODE_TYPE.equals(primaryType.getValue(Type.STRING))) {
+ PropertyState reindexProp = index.getProperty(REINDEX_PROPERTY_NAME);
+ PropertyState typeProp = index.getProperty(TYPE_PROPERTY_NAME);
+ if (reindexProp != null && reindexProp.getValue(Type.BOOLEAN) && !(typeProp != null && TYPE_DISABLED.equals(typeProp.getValue(Type.STRING)))) {
Review Comment:
Since this only makes a difference in the case of typeProp == null, I don't really care.
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#issuecomment-3613766666
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [88.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626)
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2786188198
##########
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);
+ }
+ }
+ return message;
+ }
+
+ private Set<String> getNamesOfReindexingIndexes() {
+ Set<String> reindex = new HashSet<>();
+ Iterable<Tree> indexes = context.getRoot().getTree("/" + INDEX_DEFINITIONS_NAME).getChildren();
+ for (Tree index : indexes) {
+ String name = index.getName();
+ PropertyState primaryType = index.getProperty(JCR_PRIMARYTYPE);
+ if (primaryType != null && INDEX_DEFINITIONS_NODE_TYPE.equals(primaryType.getValue(Type.STRING))) {
+ PropertyState reindexProp = index.getProperty(REINDEX_PROPERTY_NAME);
+ if (reindexProp != null && reindexProp.getValue(Type.BOOLEAN)) {
+ reindex.add(name);
+ }
Review Comment:
If that's a weird case, should we add a DEBUG log for this somewhere?
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#issuecomment-3889997699
Ok. Can we close the loop on this soon? Would be good to have it in 1.92.0....
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "thomasmueller (via GitHub)" <gi...@apache.org>.
thomasmueller commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2773986115
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java:
##########
@@ -1257,16 +1263,10 @@ public boolean isPotentiallySlow() {
@Override
public void verifyNotPotentiallySlow() {
if (potentiallySlowTraversalQuery) {
- QueryOptions.Traversal traversal = queryOptions.traversal;
- if (traversal == Traversal.DEFAULT) {
- // use the (configured) default
- traversal = settings.getFailTraversal() ? Traversal.FAIL : Traversal.WARN;
- } else {
- // explicitly set in the query
- traversal = queryOptions.traversal;
- }
- String caller = IndexUtils.getCaller(settings.getIgnoredClassNamesInCallTrace());
- String message = "Traversal query (query without index): " + statement + "; called by " + caller + "; consider creating an index";
+ Traversal traversal = queryOptions.traversal == Traversal.DEFAULT ?
+ settings.getFailTraversal() ? Traversal.FAIL : Traversal.WARN :
+ queryOptions.traversal;
Review Comment:
I actually find the earlier version a bit more readable....
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#issuecomment-3909096126
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [87.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2626)
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11697: Indexing / query limit / traversal error: improve diagnostics [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #2626:
URL: https://github.com/apache/jackrabbit-oak/pull/2626#discussion_r2569039999
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java:
##########
@@ -1267,6 +1269,9 @@ public void verifyNotPotentiallySlow() {
}
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) {
Review Comment:
I would swap plan and index information, as the latter might be more relevant
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org