jiangxt2 opened a new pull request, #13188: URL: https://github.com/apache/gravitino/pull/13188
### What changes were proposed in this pull request? Use wider arithmetic for the Lance REST pagination end index before clamping it to the list size, and add focused unit coverage for normal, boundary, validation, and `Integer.MAX_VALUE` pagination cases. ### Why are the changes needed? `PageUtil.splitPage` currently evaluates `startIndex + pageSize` as an `int`. A valid continuation token combined with `Integer.MAX_VALUE` can wrap the end index to a negative value and fail the list operation. The change preserves the existing page-token format, limit validation, sorting, and next-token behavior. Fix: #13185 ### Does this PR introduce _any_ user-facing change? It does not change public APIs or REST routes. Valid pagination requests that previously failed because of integer overflow now return the expected page; ordinary pagination behavior remains unchanged. ### How was this patch tested? - `./gradlew :lance:lance-common:test --tests 'org.apache.gravitino.lance.common.ops.gravitino.TestPageUtil' -PskipITs` — passed with 14 tests, 0 skipped, 0 failures, and 0 errors. - `./gradlew :lance:lance-rest-server:test -PskipITs` — passed; this module holds the callers of the pagination helper, and its `TestGravitinoLanceNamespaceListFiltering` exercises namespace and table listing with `limit=1` and `limit=10` through them (integration tests are excluded by `-PskipITs`). - `./gradlew :lance:lance-common:spotlessCheck`, `./gradlew rat`, and `git diff --check` — passed. - A pre-fix Docker REST reproduction against the Gravitino 1.3.0 deployment confirmed the overflow response and was cleaned up; the unit tests above ran on the current fix worktree based on main, and no post-fix Docker run was performed because this change is confined to a deterministic in-memory pagination helper. -- 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]
