Fix data exchange failure propagation - #18468
Draft
JackieTien97 wants to merge 1 commit into
Draft
Conversation
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.
Description
What changed
SourceHandlecannot reserve memory, then rethrow the original error through the existing Thrift error path.ShuffleSinkHandle.close()andabort()termination ownership to prevent mixed terminal callbacks under races.Root cause
The last failed sink channel previously decremented the channel count before invoking its failure callback. The count reaching zero closed the
ShuffleSinkHandle, which could mark the upstream fragment instance as finished before the failure was recorded. On the receiver, an exception raised while reserving memory escaped the RPC without notifying the target fragment instance, so the query could remain active until timeout. Normal and abnormal cleanup also shared the same close path, allowing close and abort callbacks to race.Compatibility and impact
Queries now record the receiver-side failure before returning the RPC error and fail promptly after terminal upstream retries instead of waiting for query timeout. The Thrift interface and wire schema are unchanged, so this remains compatible with rolling upgrades.
Verification
mvn test -pl iotdb-core/datanode -Dtest=MPPDataExchangeManagerTest,SourceHandleTest,SinkChannelFailurePropagationTest,ShuffleSinkHandleTest,SinkChannelTest -DfailIfNoTests=falseThis PR has:
Key changed/added classes
MPPDataExchangeManager.ISinkChannelListenerImplSourceHandleShuffleSinkHandleSinkChannelFailurePropagationTest