Skip to content

[Pipe] Refresh credential user IDs and retain privilege metadata across retries - #18914

Merged
jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:codex/fix-pipe-credential-user-id
Oct 20, 2026
Merged

jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:codex/fix-pipe-credential-user-id

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

A pipe created from a root session receives an injected source.user-id=0. After ALTER PIPE ... MODIFY SOURCE changes its username and password to another account, merged attributes retain that root ID. Table permission checks can continue treating the pipe as root and transfer data before SELECT permission is granted.

Resolve user IDs from explicit source and write-back sink usernames during create, replace and modify operations. Password-only modifications preserve the existing user ID.

Correctly enforcing the new identity also exposes a TsFile retry defect: throwIfNoPrivilege() clears table names and tree schema metadata after each check. A denied table event then throws a null-pointer exception on retry and cannot recover after SELECT is granted. Retain this metadata until the event releases its resources, including when processing fails after a successful check.

Regression coverage includes attribute merging, explicit credentials, password-only updates, repeated denial, grant/retry, revoke/retry, and repeated realtime tree permission checks.

Validation

  • Confirmed the new retry regression fails before the fix with the same tableNames null-pointer exception as the original CI logs.
  • PipeTsFileInsertionEventTest, PipeAuthenticationIdentityTest and ShowCreateTaskTest: 15 tests passed.
  • IoTDBPipePermissionIT#testSourcePermission: passed in 61 seconds with two HighPerformanceMode clusters (Ratis/Ratis/IoT, schema replication 3, data replication 2).
  • Spotless, changed-file Checkstyle, DataNode Apache RAT and git diff --check passed.

This PR has:

  • been self-reviewed.
  • added unit tests to cover the changed code paths.

Key changed/added classes
  • TableConfigTaskVisitor
  • PipeAuthenticationIdentityTest
  • PipeTsFileInsertionEvent
  • PipeTsFileInsertionEventTest

@Caideyipi Caideyipi changed the title [Pipe] Refresh pipe user IDs when credentials change [Pipe] Refresh credential user IDs and retain privilege metadata across retries Oct 19, 2026
@Caideyipi Caideyipi mentioned this pull request Oct 19, 2026
@jt2594838
jt2594838 merged commit 2abe6e9 into apache:master Oct 20, 2026
38 of 39 checks passed
@jt2594838
jt2594838 deleted the codex/fix-pipe-credential-user-id branch October 20, 2026 02:07
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