JackieTien97 opened a new pull request, #18197:
URL: https://github.com/apache/iotdb/pull/18197

   ## Description
   
   Backport [#18149](https://github.com/apache/iotdb/pull/18149) to `dev/1.3`.
   
   ### Enforce the configured REST response limit
   
   - Treat `rest_query_default_row_size_limit` as a hard upper bound for REST 
v1/v2 query responses.
   - Clamp caller-provided `rowLimit` / `row_limit` to the configured limit.
   - Fall back to the built-in default of 10,000 rows when the configured value 
is non-positive.
   - Check incoming TsBlocks before materializing them, while allowing results 
exactly at the limit.
   
   ### Cover Grafana and fast-last paths
   
   - Apply the same hard limit to Grafana variables, node, and expression 
endpoints.
   - Limit the v2 fast-last cache-hit path, which previously built the response 
directly.
   - Centralize limit resolution and exceeded-limit responses in 
`QueryRowLimitUtils`.
   
   ### dev/1.3 adaptations
   
   The original PR targets the newer standalone REST module. This backport 
preserves the `dev/1.3` layout and APIs:
   
   - Uses `iotdb-core/datanode`, `org.apache.iotdb.db.protocol.rest.*`, and 
`javax.ws.rs`.
   - Adapts fast-last handling to the 1.3 cache shape: `Map<PartialPath, 
Map<String, TimeValuePair>>`.
   - Omits the newer table-v1 REST and REST i18n files because those components 
do not exist on `dev/1.3`.
   
   ### Validation
   
   - `mvn spotless:apply -pl iotdb-core/datanode`
   - `mvn -q clean test -pl iotdb-core/datanode -am 
-Dtest=QueryRowLimitUtilsTest,QueryDataSetHandlerTest,FastLastHandlerTest 
-Dsurefire.failIfNoSpecifiedTests=false`
     - 8 tests passed, 0 failures, 0 errors.
   - `git diff --check origin/dev/1.3...HEAD`
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] added documentation for modified behavior.
   - [x] added comments explaining non-obvious behavior.
   - [x] added unit tests for the new code paths.
   
   <hr>
   
   ##### Key changed/added classes
   
   - `QueryRowLimitUtils`
   - REST v1/v2 `QueryDataSetHandler`
   - REST v1/v2 `RestApiServiceImpl`
   - Grafana v1/v2 `GrafanaApiServiceImpl`
   - v2 `FastLastHandler`
   


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