You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/04/19 17:57:19 UTC

[GitHub] [solr] madrob commented on a change in pull request #78: SOLR-15252 Solr should log WARN log when a query requests huge rows number

madrob commented on a change in pull request #78:
URL: https://github.com/apache/solr/pull/78#discussion_r616059443



##########
File path: solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
##########
@@ -236,6 +240,21 @@ public void prepare(ResponseBuilder rb) throws IOException
     if (rb.getSortSpec().getOffset() < 0) {
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "'start' parameter cannot be negative");
     }
+    if(rb.getSortSpec().getCount() > ROWS_WARN_THRESHOLD && shouldLogPeriodically("rowsWarn", 60)) {
+      log.warn("Very high 'rows' parameter detected. This may lead to performance- and memory problems. " +
+          "Consider pagination, see https://solr.apache.org/guide/pagination-of-results.html. " +
+          "This warning will mute for 60s.");

Review comment:
       I think maybe 300s is a better compromise. I'd probably miss something that logs hourly, based on my experiences with heavily used clusters - there are plenty of WARN messages already about slow queries, leader elections, other "normal" operations in a large cluster.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org