joerghoh commented on code in PR #1012:
URL: https://github.com/apache/jackrabbit-oak/pull/1012#discussion_r1260025107


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/cursor/TraversingCursor.java:
##########
@@ -159,10 +159,15 @@ private void fetchNext() {
 
                 readCount++;
                 if (readCount % 1000 == 0) {
-                    FilterIterators.checkReadLimit(readCount, settings);
-                    String caller = 
IndexUtils.getCaller(this.settings.getIgnoredClassNamesInCallTrace());
-                    LOG.warn("Traversed {} nodes with filter {} called by {}; 
consider creating an index or changing the query" , 
-                            readCount, filter, caller);
+                    if (readCount == 20000) {
+                        LOG.warn("Traversed {} nodes with filter {}; consider 
creating an index or changing the query",
+                                readCount, filter, new Exception("call 
stack"));

Review Comment:
   Why do you log the full stack trace? Isn't logging the caller (as it is done 
a few lines alter by 
   ```
   String caller = 
IndexUtils.getCaller(this.settings.getIgnoredClassNamesInCallTrace());
   ```
   
   good enough? The stack trace creates a lot more noise, and I don't see it to 
be more actionable in the first place.



##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/ContentMirrorStoreStrategy.java:
##########
@@ -457,9 +457,15 @@ private void fetchNextPossiblyDuplicate() {
                         readCount++;
                         if (readCount % TRAVERSING_WARN == 0) {
                             FilterIterators.checkReadLimit(readCount, 
settings);
-                            String caller = 
IndexUtils.getCaller(settings.getIgnoredClassNamesInCallTrace());
-                            LOG.warn("Index-Traversed {} nodes ({} index 
entries) using index {} with filter {}, caller {}", 
-                                    readCount, intermediateNodeReadCount, 
indexName, filter, caller);
+                            if (readCount == 2 * TRAVERSING_WARN) {
+                                LOG.warn("Index-Traversed {} nodes ({} index 
entries) using index {} with filter {}",
+                                        readCount, intermediateNodeReadCount, 
indexName, filter,
+                                        new Exception("call stack"));

Review Comment:
   same as above.



-- 
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]

Reply via email to