Skip to content

Retry Pipe sinks after transient resource failures - #19379

Merged
jt2594838 merged 3 commits into
apache:masterfrom
Caideyipi:fix/pipe-sink-resource-retry
Nov 25, 2026
Merged

jt2594838 merged 3 commits into
apache:masterfrom
Caideyipi:fix/pipe-sink-resource-retry

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Motivation

Transient resource failures during Pipe transfers can be wrapped by connector exceptions and treated as permanent sink failures. This can stop a Pipe instead of retrying, including when an asynchronous sink reaches its forced retry threshold.

Changes

  • Preserve a dedicated exception type for AutoResizingBuffer allocation exhaustion.
  • Classify resource failures through wrapped causes and connection-exception paths.
  • Keep transient transport/resource failures retryable while preserving STOP behavior for ordinary I/O and configuration or authentication failures.
  • Preserve resource-failure classification when an asynchronous sink reaches its forced retry threshold.

Verification

Spotless passed. The targeted Maven run passed 55 tests with no failures, errors, or skips.

}
}

if (throwable instanceof Exception && !PipeStopStrategy.accept((Exception) throwable, null)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

major iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeAbstractSinkSubtask.java:110 — Resource-failure short-circuit skips handshake for connection-reset PipeConnectionException

The new block at line 110 runs before the throwable instanceof PipeConnectionException branch. A PipeConnectionException wrapping TTransportException("Connection reset"/"Broken pipe") is now classified as NETWORK_TIMEOUT, so onPipeConnectionException()/handshakeOutputPipeSink() is never called and the broken client is never re-established; the subtask only resubmits itself and keeps failing on the same dead connection. The new test testConnectionResetRetriesLocallyWhenConnectionRetryIsDisabled
…[truncated]

Fix: Evaluate the PipeConnectionException branch (handshake/reconnect) before the resource-failure short-circuit, or exclude PipeConnectionException from the new block so reconnect still happens; update the test to assert handshake is attempted.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the report. Fixed in 470f3958e8d9c31b951dd012d8ba264c9880088f: onFailure now attempts the PipeConnectionException handshake/reconnect before applying the transient resource-failure retry path.

The regression test now verifies that handshake() is attempted when local connection retry is disabled.

Validation passed: mvn spotless:apply -P with-integration-tests and mvn clean test -P with-integration-tests -pl iotdb-core/datanode -am -Dtest=PipeSinkSubtaskTest -Dsurefire.failIfNoSpecifiedTests=false (14 tests, 0 failures).

@Caideyipi

Copy link
Copy Markdown
Collaborator Author

Review-comment handling round for head bbafac542d2195a1b0d6c7d636aeb3f5593bc4f1: fixed the connection-reset path so PipeConnectionException reaches handshake/reconnect before transient resource-failure short-circuiting, and updated testConnectionResetRetriesLocallyWhenConnectionRetryIsDisabled to assert the handshake.

Validation: mvn spotless:apply -P with-integration-tests passed. mvn clean test -P with-integration-tests -pl iotdb-core/datanode -am -Dtest=PipeSinkSubtaskTest -Dsurefire.failIfNoSpecifiedTests=false passed (14 tests, 0 failures, 0 errors, 0 skipped).

Reviewed SHA: bbafac542d2195a1b0d6c7d636aeb3f5593bc4f1
Final local SHA: 470f3958e8d9c31b951dd012d8ba264c9880088f
Confirmed remote source branch and PR head SHA: 470f3958e8d9c31b951dd012d8ba264c9880088f

The PR remains open, and the inline discussion is intentionally left unresolved.

@jt2594838
jt2594838 merged commit dbbe38a into apache:master Nov 25, 2026
39 checks passed
@jt2594838
jt2594838 deleted the fix/pipe-sink-resource-retry branch November 25, 2026 02:53
Caideyipi added a commit that referenced this pull request Nov 25, 2026
…) (#19401)

* Add RPC auto resizing buffer memory control (#17911)

* ver1

* ver2

* ver3

* ver4

* ver4

* update default config value

* Disable when proportion <= 0

* fix review

* disable mem-control in ITs

* Replace auto_resizing_buffer_memory_proportion with datanode_memory_proportion

* Add AutoResizingBuffer memory metrics

* Fix it

(cherry picked from commit 1073715)

* Fix RPC buffer memory control activation (#18194)

Avoid activating DataNode RPC buffer memory control during configuration loading, and bind auto-resizing buffers to the memory account used for their allocation.

(cherry picked from commit 0d3304a)

* Retry Pipe sinks after transient resource failures (#19379)

* Retry Pipe sinks after transient resource failures

* Restore Pipe sink handshake on connection reset

(cherry picked from commit dbbe38a)

---------

Co-authored-by: Jiang Tian <jt2594838@163.com>
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.

3 participants