Skip to content

Conversation

lukasz-soszynski-eliatra

Description

The PR introduces "query string query" monitoring mode. The mode is by default disabled. If the system administrator enables the mode (using the configuration property search.query.max_query_string_length_monitor_only), then the OS executes queries that exceed the max length limit and logs an additional warning message.

The PR is related to the discussion

Related Issues

#19491 (comment)

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@lukasz-soszynski-eliatra lukasz-soszynski-eliatra force-pushed the query-string-query-length-monitor-mode branch from ac1cdd7 to 377eca4 Compare October 6, 2025 14:31
Copy link
Contributor

github-actions bot commented Oct 6, 2025

❌ Gradle check result for 377eca4: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@kkhatua kkhatua requested a review from jainankitk October 6, 2025 16:35
@kkhatua
Copy link
Member

kkhatua commented Oct 6, 2025

Tagging @cwperks , @jainankitk for a review.

@cwperks
Copy link
Member

cwperks commented Oct 7, 2025

@kkhatua I'm not really in favor of one-off settings like this. The max-length setting introduced in #19491 is already changeable dynamically.

What do you think about making any responses that exceed the configured max length to be actionable? i.e. the response should not just be that the request fails, but state the reason for failure and how to adjust the max length setting.

This is from one of the tests:

assertThat(e.getDetailedMessage(), containsString("Query string length exceeds max allowed length 10"));

Maybe we can specify the setting name in that message?

@kumargu
Copy link
Contributor

kumargu commented Oct 8, 2025

@kkhatua I'm not really in favor of one-off settings like this. The max-length setting introduced in #19491 is already changeable dynamically.

What do you think about making any responses that exceed the configured max length to be actionable? i.e. the response should not just be that the request fails, but state the reason for failure and how to adjust the max length setting.

This is from one of the tests:

assertThat(e.getDetailedMessage(), containsString("Query string length exceeds max allowed length 10"));

Maybe we can specify the setting name in that message?

yeah having a failure reason would be useful.

@kkhatua
Copy link
Member

kkhatua commented Oct 9, 2025

Agree on providing a failure reason with the settings to modify, similar to other settings.
However, the monitoring mode ensures this is an optional breaking change.

Tagging @jainankitk to review. Would be good to have this for 3.3 release, but it's not a must.

@cwperks
Copy link
Member

cwperks commented Oct 9, 2025

Fixed the conflicts due to the CHANGELOG being cleared. The content of this change looks good to me. I was comparing this more to XContentConstraint where there is a max enforced in the Jackson library itself. Similar to Lucene BoolQuery with 1024 max clause count:

@cwperks cwperks added the backport 3.3 Backport to 3.3 branch label Oct 9, 2025
Copy link
Contributor

github-actions bot commented Oct 9, 2025

✅ Gradle check result for 25b7541: SUCCESS

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.09%. Comparing base (006a53f) to head (25b7541).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...pensearch/index/search/QueryStringQueryParser.java 33.33% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19539      +/-   ##
============================================
+ Coverage     73.05%   73.09%   +0.04%     
+ Complexity    70627    70608      -19     
============================================
  Files          5723     5723              
  Lines        323489   323502      +13     
  Branches      46851    46852       +1     
============================================
+ Hits         236311   236468     +157     
+ Misses        68174    67959     -215     
- Partials      19004    19075      +71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kkhatua kkhatua added v3.4.0 Issues and PRs related to version 3.4.0 and removed backport 3.3 Backport to 3.3 branch labels Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3.4.0 Issues and PRs related to version 3.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants