andyhuangdev opened a new pull request, #11902: URL: https://github.com/apache/ozone/pull/11902
## What changes were proposed in this pull request? MappedBufferManager returns a duplicate of the mapped buffer for both new mappings and cache hits, giving each reader an independent position and limit while sharing the underlying data. Previously, concurrent readers could modify the cached buffer’s position and limit during ByteString conversion. This could cause incorrect read responses, subsequent mapped reads to stop progressing, and repeated quota releases. A regression test verifies that consuming a new mapping or changing a cache hit’s limit does not affect the cached buffer or subsequent readers. ## What is the link to the Apache JIRA [HDDS-17370](https://issues.apache.org/jira/browse/HDDS-17370) ## How was this patch tested? The regression test was added first and confirmed to fail before the fix with expected: 1024 but was: 0. After the fix, all 46 tests passed across: - TestMappedBufferManager - TestChunkUtils - TestFilePerBlockStrategy - TestFilePerChunkStrategy Tests ran under JDK 21. Repository checkstyle and git diff --check also passed. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
