IGNITE-28980 BinaryMemoryAllocator$ThreadLocalAllocator$Chunk resets maxMsgSize on shrink check - #13487
Conversation
mroeppis
commented
Aug 16, 2026
- reset maxMsgSize on shrink check to allow for lower size on next check
- test covers shrink behavior to verify feature
|
Minor issue: remove the colon after ticket number |
There was a problem hiding this comment.
Pull request overview
This PR updates the thread-local binary memory allocator shrink logic so that the tracked maxMsgSize is reset after each periodic shrink check, allowing subsequent checks to shrink the buffer based on newer (possibly smaller) message sizes. It also adds a regression test intended to validate the shrink behavior after writing a large message followed by a small one.
Changes:
- Reset
BinaryMemoryAllocator.ThreadLocalAllocator.Chunk.maxMsgSizeafter each shrink check. - Add
ThreadLocalAllocatorChunkShrinkTestto validate that the thread-local buffer shrinks after a small write following a large write.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| modules/binary/impl/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocator.java | Resets maxMsgSize after the time-based shrink check to allow shrinking based on later smaller messages. |
| modules/core/src/test/java/org/apache/ignite/internal/binary/streams/ThreadLocalAllocatorChunkShrinkTest.java | Adds a JUnit test that exercises “large write then small write” and asserts the thread-local buffer shrinks accordingly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@mroeppis plz check and fix code style failures |
…ot reset maxMsgSize after shrink check * reset maxMsgSize on shrink check * test covers shrink behavior
|
ok, now it`s fine i will run TC by myself at this time, will wait also approve from @chesnokoff |
|
@mroeppis TC still in progress, i see - that you try to run a TC but have no progress [1] it`s all due to initial - code style check errors, you also can run checkstyle locally before push: for example like : mvn clean install -DskipTests -Pcheckstyle. Now styles are ok and i re-run TC. |
chesnokoff
left a comment
There was a problem hiding this comment.
Non-blocking nit: a few comments in new test could be polished for punctuation and capitalization but the fix looks good to me