Fix IndexOutOfBoundsException in CompressingDecryptingPageDeserializer#29094
Fix IndexOutOfBoundsException in CompressingDecryptingPageDeserializer#29094trina242 wants to merge 1 commit intotrinodb:masterfrom
Conversation
When fault-tolerant execution is enabled (retry-policy=TASK), small pages that fit within a single encrypted block cause an IndexOutOfBoundsException during deserialization. This happens because decrypt() unconditionally reads the next encrypted block header from the source buffer without checking if the source has been fully consumed. When ensureReadable() triggers a second decrypt() call after all encrypted blocks have already been processed, source.readInt() reads past the end of the buffer. Add an early return in both decrypt() and decompress() when their respective source buffers have no remaining data, which is the correct behavior when all blocks have been consumed. Fixes trinodb#23531 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request adds early-return guards to the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks - can you add a test coverage for that? Let me know if you do not have time for that then I will take a look (eventually). |
|
This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack. |
When fault-tolerant execution is enabled
(retry-policy=TASK), small pages that fit within a single encrypted block cause anIndexOutOfBoundsExceptionduring deserialization. This happens becausedecrypt()unconditionally reads the next encrypted block header from the source buffer without checking if the source has been fully consumed. WhenensureReadable()triggers a seconddecrypt()call after all encrypted blocks have already been processed,source.readInt()reads past the end of the buffer.Add an early return in both
decrypt()anddecompress()when their respective source buffers have no remaining data, which is the correct behavior when all blocks have been consumed.Fixes #23531
Description
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: