Improve pipe runtime memory allocation#18051
Open
Caideyipi wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18051 +/- ##
============================================
+ Coverage 41.40% 41.59% +0.19%
Complexity 318 318
============================================
Files 5286 5294 +8
Lines 369547 371580 +2033
Branches 47815 48076 +261
============================================
+ Hits 153008 154566 +1558
- Misses 216539 217014 +475 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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.


Summary
Root cause fixed
In the failing path,
PipeTsFileInsertionEvent.consumeTabletInsertionEventsWithRetrycaughtPipeRuntimeOutOfMemoryCriticalExceptionand retried the same parsed tablet indefinitely. The parser still held temporary tablet/chunk/page memory while the consumer was trying to allocate memory for the downstreamPipeRawTabletInsertionEvent. With multiple pipes parsing large TsFiles concurrently, this could saturate the tablet memory pool and form a live-lock: pipe stays RUNNING, butsub_remain_eventdoes not decrease and no tablet is transferred.Implementation details
Tabletto a raw tablet event.lastEventand retries later.AtomicReference(PipeProcessorSubtask,DownSamplingProcessor,AggregateProcessor).PipeMemoryManager.resize(..., 0)releases memory.allocatedBlocks; also register zero-size blocks expanded throughtryAllocate(block, ...).Tests
TsFileInsertionEventParserTest:testScanParserReleasesTabletMemoryAfterRawTabletGeneratedtestConsumeTabletInsertionEventsWithRetryReleasesParserOnOutOfMemorymvn spotless:apply -pl iotdb-core/datanodegit diff --checkmvn -pl iotdb-core/datanode '-Dtest=TsFileInsertionEventParserTest#testScanParserReleasesTabletMemoryAfterRawTabletGenerated+testConsumeTabletInsertionEventsWithRetryReleasesParserOnOutOfMemory' '-Dspotless.check.skip=true' '-Dcheckstyle.skip=true' testConsensusSubscriptionSetupHandler: missingTopicConstant.COLUMN_KEYandTopicConstant.COLUMN_DEFAULT_VALUE.mvn -pl iotdb-core/datanode -DskipTests '-Dspotless.check.skip=true' '-Dcheckstyle.skip=true' compileTopicConstant.COLUMN_*compile errors.No new IT is added because this is a low-level parser/memory-manager recovery path and the deterministic UTs cover the parser-memory release and OOM cleanup behavior directly. The original 10-pipe/2kw scenario should be used as the regression workload for end-to-end validation.