Enforce REST query row limit as hard cap#18149
Open
JackieTien97 wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18149 +/- ##
============================================
- Coverage 41.87% 41.65% -0.22%
- Complexity 318 343 +25
============================================
Files 5297 5328 +31
Lines 374093 376418 +2325
Branches 48287 48690 +403
============================================
+ Hits 156645 156809 +164
- Misses 217448 219609 +2161 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…n tests A non-positive rest_query_default_row_size_limit used to mean "unlimited"; the hard-cap handling clamped it down to 1, silently capping every REST response to a single row. Remap non-positive values to the built-in default (10000) so existing deployments are not degraded, while still guaranteeing a finite cap. Add regression coverage: - QueryRowLimitUtilsTest: an oversized caller-provided rowLimit is clamped to the configured hard limit. - FastLastHandlerTest: the fastLastQuery cache-hit path caps the number of materialized entries. The cache-hit loop is extracted into FastLastHandler.fillLastValueDataSet so it is unit-testable.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
This PR makes
rest_query_default_row_size_limitthe hard upper bound for REST and Grafana query responses.Changes
rowLimit/row_limitwithrest_query_default_row_size_limit.0.QueryRowLimitUtils.Validation
mvn spotless:apply -pl external-service-impl/restmvn test -pl external-service-impl/rest -Dtest=QueryRowLimitUtilsTest,QueryDataSetHandlerTestmvn test-compile -pl external-service-impl/rest -P with-zh-locale -DskipTestsmvn test-compile -pl external-service-impl/rest-openapi -DskipTestsgit diff --check