Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter to limit the size of a query string #4320

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kamalesh0406
Copy link
Contributor

Description

I added the parameter to limit the size of the query string in a user input. Further, I moved validate_request out of the for loop since many of the checks inside it did not require to be run for each index_metadata.

An alternate approach for checking the query size could be to match the enums in the serialized query_ast value and check the size of the actual user input.

How was this PR tested?

New unit tests to check if the error is thrown.

@@ -187,6 +188,7 @@ impl Default for SearcherConfig {
max_num_concurrent_split_searches: 100,
aggregation_memory_limit: ByteSize::mb(500),
aggregation_bucket_limit: 65000,
query_string_size_limit: ByteSize::b(1024),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This limit is too low. For Jaeger, we need to make queries with at least 100 trace ID terms or even bigger ones. A trace ID is 128 bits, we represent it in hex string, so 2 characters for each byte, so we need 32 chars, and I'm not counting the field name size, which has 8 characters.

I feel like we should either put a limit on the number of terms, like 1K terms, or set a 100kb in terms of size.

@fulmicoton @guilload any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I go ahead with increasing the default size of the terms to 100kb @fulmicoton @guilload ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants