Skip to content

Fix config region pipe privilege trimming#18142

Merged
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix-config-region-pipe-privilege-trim
Jul 8, 2026
Merged

Fix config region pipe privilege trimming#18142
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix-config-region-pipe-privilege-trim

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Avoid falling back to the table privilege visitor when a tree/config plan is denied by tree privilege trimming.
  • Preserve the trimmed plan between tree and table privilege visitor stages.
  • Add regression coverage for unauthorized tree plans and partially trimmed tree plans.

Reproduction

A minimal reproduction is covered by PipeConfigTreePrivilegeParseVisitorTest#testSourcePrivilegeTrimDoesNotFallbackToTableDefaultForTreePlan:

  • Give the pipe source user READ_SCHEMA only on root.db.device.**.
  • Feed IoTDBConfigRegionSource a realtime tree config plan, e.g. SetTTLPlan(root.db2.device.measurement, 100).
  • Before this fix, tree privilege trimming returns empty, but the table privilege visitor still runs and falls back to its default visitPlan, so the unauthorized tree plan is transferred instead of being skipped or rejected.
  • For a partially matched tree plan such as SetTTLPlan(root.*.device.measurement, 100), the fixed flow keeps the trimmed plan as root.db.device.measurement.

Run the regression test with:

mvn -pl iotdb-core/node-commons -DskipTests install
mvn -pl iotdb-core/confignode -Dtest=PipeConfigTreePrivilegeParseVisitorTest#testSourcePrivilegeTrimDoesNotFallbackToTableDefaultForTreePlan -Dsurefire.failIfNoSpecifiedTests=false test

Tests

  • mvn spotless:apply -pl iotdb-core/confignode
  • mvn -pl iotdb-core/node-commons -DskipTests install
  • mvn -pl iotdb-core/confignode -Dtest=PipeConfigTreePrivilegeParseVisitorTest -Dsurefire.failIfNoSpecifiedTests=false test

@jt2594838 jt2594838 merged commit b353905 into apache:master Jul 8, 2026
40 of 41 checks passed
@jt2594838 jt2594838 deleted the fix-config-region-pipe-privilege-trim branch July 8, 2026 03:39
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