Skip to content

[Pipe] Account asynchronous transfer memory - #19415

Draft
Caideyipi wants to merge 2 commits into
apache:masterfrom
Caideyipi:codex/pipe-memory-origin-pr-20261126
Draft

Caideyipi wants to merge 2 commits into
apache:masterfrom
Caideyipi:codex/pipe-memory-origin-pr-20261126

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Problem

Under high request concurrency, a large Pipe transfer can retain serialized Thrift bodies and temporary transport or compression buffers until asynchronous callbacks complete. These allocations are not fully represented in Pipe memory accounting, so sustained transfers can exceed the configured budget.

Changes

  • Reserve memory before allocating serialized Thrift bodies and account for actual buffer capacity.
  • Track request, compression-peak, and slice/transport-copy memory during asynchronous transfers.
  • Release reservations on completion, transport failure, fallback, synchronous exceptions, and Error paths.
  • Add regression coverage for buffer growth and callback cleanup.

Example

Repeatedly transfer a tablet request larger than the configured slice threshold while RPC callbacks are delayed. Previously, each in-flight request could retain untracked request, slice, and compression buffers. The sender now reserves those buffers and releases them as callbacks terminate.

Validation

  • spotless:apply -P with-integration-tests -pl iotdb-core/datanode,iotdb-core/node-commons passed.
  • clean test -pl iotdb-core/datanode,iotdb-core/node-commons -am passed: 26 tests, 0 failures, 0 errors.

@Caideyipi
Caideyipi marked this pull request as draft November 26, 2026 09:54
@Caideyipi

Copy link
Copy Markdown
Collaborator Author

Initial self-review — targeted CI fix

Reviewed SHA: 6a22e8a88f1d85d62af149ae704d9052462b2ed3 (base: ee10b1ea335e6fa00c6c4dafdb3594a0577ba3f4).

Finding: The new LZMA2 memory-accounting code references org.tukaani.xz.LZMA2Options, but node-commons did not directly declare org.tukaani:xz; Maven dependency analysis reported it as undeclared.

Fix: Added org.tukaani:xz to iotdb-core/node-commons/pom.xml.

Verification: mvn clean verify -pl iotdb-core/node-commons -am -DskipTests -Drat.skip=true passed, and the node-commons dependency check reported no problems. Tests were skipped. The first local reactor attempt stopped earlier at Apache RAT on five Go client files, so the successful retry skipped RAT to reach the target check.

Final local SHA: 6a22e8a88f1d85d62af149ae704d9052462b2ed3.
Confirmed source-branch and PR-head SHA: 6a22e8a88f1d85d62af149ae704d9052462b2ed3.
GitHub status for the new head was pending when checked.

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.

1 participant