Fix Pipe tablet memory resize admission limit - #18413
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Pipe tablet parser can reserve a zero-sized memory block and grow it with
forceResize(). The resize path previously checked only the remaining Pipe memory, so one expansion could exceed the Tablet category hard limit. Subsequent small allocations could then be rejected.This change checks projected category usage, including the pending resize amount, for Tablet and TsFile memory blocks before allocation. A rejected resize leaves the block and memory accounting unchanged.
The regression test covers a zero-sized Tablet block whose resize would cross the Tablet hard limit.
Verification
mvn spotless:apply -pl iotdb-core/datanodemvn -o compile -pl iotdb-core/datanode -DskipTests -Dcheckstyle.skip=truePipeMemoryManagerResizeTestcompiled with the module test classpath and run via JUnitCore: 2 tests passed.The Maven test goal exceeded the local five-minute test-compilation timeout; the GitHub Actions checks are running on the PR.