Improve pipe runtime memory allocation#18051
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18051 +/- ##
============================================
+ Coverage 41.81% 41.84% +0.02%
Complexity 318 318
============================================
Files 5296 5296
Lines 373384 373585 +201
Branches 48210 48204 -6
============================================
+ Hits 156134 156324 +190
- Misses 217250 217261 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jt2594838
reviewed
Jul 3, 2026
…namic-memory-allocation # Conflicts: # iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodePipeMessages.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/iotconsensusv2/payload/builder/IoTConsensusV2TransferBatchReqBuilder.java
|
jt2594838
pushed a commit
that referenced
this pull request
Jul 7, 2026
* Improve pipe runtime memory allocation * Fix pipe TsFile parser memory self-lock * Fix Chinese pipe TsFile parser i18n message * Fix TsFile parser OOM retry test setup * Address pipe dynamic memory review comments * Fix scan parser tablet memory release * Deduplicate pipe meta heartbeat reporting * Reduce pipe sync file transfer duplication * Fix pipe i18n review comments (cherry picked from commit 35cf94a)
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.