Skip to content

Pipe: Fix leader cache updates for multi-device redirects - #18689

Merged
jt2594838 merged 2 commits into
masterfrom
fix/tdb-30-pipe-leader-cache
Sep 22, 2026
Merged

jt2594838 merged 2 commits into
masterfrom
fix/tdb-30-pipe-leader-cache

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Multi-device insert-node responses can carry leader redirections in per-device sub-statuses. The pipe sender previously handled only a top-level redirect for direct insert-node transfers, so its leader cache could remain stale and repeatedly route writes to the wrong receiver node.

This change:

  • adds device paths to redirection sub-statuses for direct insert-node and binary requests;
  • recursively extracts per-device redirects from variable-sized batch/direct responses;
  • updates both async and sync sink leader caches for every redirected device;
  • adds coverage for multi-device, single-device, nested, diagnostic, and non-redirection statuses.

Validation

  • Targeted tests: 7/7 passed on the 2.0.12.1 source baseline before porting the patch to master.
  • mvn -pl iotdb-core/datanode spotless:check -DskipTests -Dcheckstyle.skip=true
  • git diff --check

The 40 GB cluster workload has not been rerun locally. A targeted test rerun after switching to master was blocked by unrelated stale cross-module generated artifacts/dependencies in the local checkout; none of the reported compilation errors referenced the files changed here.

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.87500% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.36%. Comparing base (02b8c6c) to head (0f00c1f).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...eceiver/protocol/thrift/IoTDBDataNodeReceiver.java 0.00% 6 Missing ⚠️
.../protocol/thrift/sync/IoTDBDataRegionSyncSink.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #18689   +/-   ##
=========================================
  Coverage     44.36%   44.36%           
  Complexity      712      712           
=========================================
  Files          5483     5483           
  Lines        394207   394227   +20     
  Branches      51177    51183    +6     
=========================================
+ Hits         174882   174909   +27     
+ Misses       219325   219318    -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…-30-pipe-leader-cache

# Conflicts:
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/util/cacher/LeaderCacheUtils.java
#	iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/util/cacher/LeaderCacheUtilsTest.java
@jt2594838
jt2594838 merged commit 6377522 into master Sep 22, 2026
38 of 40 checks passed
@jt2594838
jt2594838 deleted the fix/tdb-30-pipe-leader-cache branch September 22, 2026 09:36
jt2594838 pushed a commit that referenced this pull request Sep 23, 2026
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