Skip to content

[Load] Reject device paths with empty nodes before database auto-creation#18307

Open
Caideyipi wants to merge 2 commits into
apache:masterfrom
Caideyipi:fix/load-reject-illegal-device-path
Open

[Load] Reject device paths with empty nodes before database auto-creation#18307
Caideyipi wants to merge 2 commits into
apache:masterfrom
Caideyipi:fix/load-reject-illegal-device-path

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Description

A tree-model TsFile may contain a segmented device ID with an empty path node, for example root. represented as ["root", ""]. LOAD previously copied those segments into a PartialPath without structural validation and could derive an invalid root. database path.

This PR validates every device node before LOAD queries ConfigNode or attempts database auto-creation. Null or empty nodes now fail locally with a clear illegal-path error, preventing malformed TsFiles from creating invalid metadata.

The ConfigNode-wide database-path guard is handled separately in #18308.

Tests

  • mvn spotless:apply -pl iotdb-core/datanode
  • LoadTsFileAnalyzerTest compiled against the current module dependencies and run with JUnitCore (6 tests passed). The normal DataNode Maven lifecycle is currently blocked locally by unrelated stale generated Freemarker sources and SNAPSHOT dependency mismatches.

This PR has:

  • been self-reviewed.
  • added unit tests to cover the new code path.
Key changed/added class
  • TreeSchemaAutoCreatorAndVerifier

@Caideyipi Caideyipi changed the title [Load] Reject illegal device paths before database auto-creation [Load] Reject device paths with empty nodes before database auto-creation Jul 25, 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.

1 participant