Repository navigation
Replace native cursor serialization with Jackson Smile - #5802
mengweieric wants to merge 4 commits into
Conversation
Signed-off-by: menwe <menwe@amazon.com>
Signed-off-by: menwe <menwe@amazon.com>
Signed-off-by: menwe <menwe@amazon.com>
Signed-off-by: menwe <menwe@amazon.com>
|
Intent: Replace physical-plan cursor object serialization with a bounded, closed Smile schema while preserving pagination and PIT lifecycle behavior. |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 4888e61.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (63.24%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #5802 +/- ##
==========================================
Coverage 63.23% 63.24%
- Complexity 8823 8850 +27
==========================================
Files 938 941 +3
Lines 40236 40339 +103
Branches 4537 4541 +4
==========================================
+ Hits 25445 25513 +68
- Misses 13966 13995 +29
- Partials 825 831 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Has merge conflicts, but I trust this as long as CI passes. We should have sufficient ITs for cursor serialization. |
Description
V2 pagination cursors carry the physical plan state needed to fetch the next page. The current cursor envelope uses Java object serialization. That couples decoding to implementation classes and allows a broader object graph than pagination needs.
This change replaces the physical-plan envelope with a closed, versioned Jackson Smile schema. The schema accepts only
ProjectNodeandIndexScanNode. OpenSearch request state continues to use the OpenSearch transport codec, and projection expressions continue to use the existing filtered expression codec.ServiceLoaderkeeps the engine-specific flattening and rebuilding logic outsidecore.The new cursor format uses the
n:v2:prefix and standard Base64 so it is clearly separated from the legacyn:object stream. Cursor payloads are bounded by nesting depth, token count, field-name length, andplugins.query.cursor.max_bytes. The new size setting defaults to 1 MiB and has a 16 MiB administrative ceiling. This separate budget prevents the smaller per-expression limit from rejecting a valid complete cursor.PIT ownership transfers only after the complete cursor has been encoded and validated. If any serialization or validation step fails, the current plan retains ownership and closes the PIT. This preserves the lifecycle contract established by #5221 without leaving an unreachable search context.
Legacy
n:cursors are not decoded by the new format. Because cursors are opaque and short-lived, pagination that is still in progress during an upgrade must be restarted.Validation completed on Java 21:
./gradlew --continue build -x integTest -x tracingIntegTest -x yamlRestTest -x doctest./gradlew :integ-test:integTest --tests org.opensearch.sql.sql.StandalonePaginationITThe pagination design and the new cursor-size setting are documented in this repository.
Related Issues
Follow-up to #5221.
Check List
--signoffor-s.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.