Skip to content

Fix pipe tree database creation on receiver#17991

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix-pipe-tree-database-auto-create
Open

Fix pipe tree database creation on receiver#17991
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix-pipe-tree-database-auto-create

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Supersedes #17986. That PR was accidentally marked as merged while apache/master was force-restored; GitHub does not allow reopening a pull request once it has merged=true.

Description

This PR fixes tree-model pure-data pipe synchronization when the receiver does not already have the source tree database.

For pipe-generated tree inserts and TsFile loads, the receiver may carry an explicit tree database hint such as root.test.sg_0. Partition analysis uses this explicit database name directly, so the normal tree device-path based database auto-creation path is bypassed. As a result, receiver-side writes can repeatedly fail with Create DataPartition failed because the database ... is not exists.

Semantics

Receiver-side tree database creation follows these rules:

  • If the sender carries a database and the receiver does not have it, create the database according to the sender-carried database.
  • If the sender carries a database and the receiver already has it, do not create it again; ignore the sender-carried database for creation and continue executing the event normally.
  • If the sender does not carry a database, meaning it is an old-version event, keep the existing auto-inference behavior and create the database from the statement/device path.
  • A database creation conflict is treated the same as success: creation can be attempted unconditionally, and if the receiver reports conflict because the database already exists, the event continues through the normal subsequent flow.

The PR:

  • auto-creates explicit tree database hints on the DataNode receiver before executing tree insert/load statements
  • recalculates database-level when rebuilding pipe tree load retry statements
  • preserves the tree database hint when LoadTsFile fallback conversion replays tablets
  • adds a unit test for retry tree load statement database-level reconstruction
  • fixes a missing test import exposed by CI

Verification

  • mvn -DskipTests spotless:apply -pl iotdb-core/datanode
  • git diff --check

mvn -Ddevelocity.off=true compile -pl iotdb-core/datanode was also attempted, but the current workspace fails in unrelated existing datanode/generated sources, e.g. missing Accumulator, IFill, LinearFill, PipeProcessorSubtask#getDisplayTaskID(), and related symbols.

@Caideyipi Caideyipi force-pushed the fix-pipe-tree-database-auto-create branch from 52cf2da to c5ed6e9 Compare June 18, 2026 09:42
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