Skip to content

[Pipe] Prevent resizing released TsFile scan parser memory - #18350

Merged
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:codex/fix-pipe-released-memory-resize-log-flood
Jul 29, 2026
Merged

[Pipe] Prevent resizing released TsFile scan parser memory#18350
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:codex/fix-pipe-released-memory-resize-log-flood

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Problem

When TsFileInsertionEventScanParser reached EOF while producing the final tablet, prepareData() closed the parser immediately. The iterator then tried to release the parser-side tablet memory in its finally block, which called forceResize(0) on an already released memory block and could continuously emit forceResize: cannot resize a null or released memory block warnings.

Changes

  • Defer parser close at EOF until after the final tablet memory accounting is released.
  • Keep immediate cleanup in the constructor when a TsFile contains no tablet data.
  • Strengthen the parser unit test to verify that tablet memory usage is zero before its block is closed.

Tests

  • mvn spotless:apply -pl iotdb-core/datanode
  • mvn -pl iotdb-core/datanode -Dtest=TsFileInsertionEventParserTest test (21 tests, 0 failures, 3 skipped)

This PR has:

  • been self-reviewed.
  • added comments explaining the why and intent of the non-obvious close ordering.
  • modified an existing unit test to cover the regression.

Key changed/added classes
  • TsFileInsertionEventScanParser
  • TsFileInsertionEventParserTest

@jt2594838
jt2594838 merged commit a6ac4cb into apache:master Jul 29, 2026
41 checks passed
@jt2594838
jt2594838 deleted the codex/fix-pipe-released-memory-resize-log-flood branch July 29, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants