Skip to content

Optimize load logic#18153

Open
luoluoyuyu wants to merge 7 commits into
apache:masterfrom
luoluoyuyu:fix-load-write-data-auth
Open

Optimize load logic#18153
luoluoyuyu wants to merge 7 commits into
apache:masterfrom
luoluoyuyu:fix-load-write-data-auth

Conversation

@luoluoyuyu

Copy link
Copy Markdown
Member

Description

As the title said


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

@Caideyipi Caideyipi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two issues that should be addressed before merging:

  1. The new ITs rely on observing a transient file in the active-load pending directory, but the active-load worker can scan and consume the file before the assertion runs. This is already failing in CI: IoTDBLoadTsFileActiveRetryIT.testAsyncLoadShouldStoreUserInfoInActiveDir fails at line 166, and IoTDBLoadTsFileAuthIT.testAsyncLoadShouldMoveFileToFailDirWhenUserDoesNotExist fails at line 207. Please avoid asserting on this racing pending-file state, or make the loader/scanner behavior deterministic for the test.

  2. The PR adds new user-facing raw English strings in production code:

    • ActiveLoadTsFileLoader: The user in the active load path does not exist
    • ActiveLoadPathHelper: User name must not be empty

    Per the repo i18n rule, these should be moved to the corresponding StorageEngineMessages constants in both en and zh, then referenced from code.

The core permission-checking approach looks reasonable to me, but the CI-breaking flaky tests and the i18n literals should be fixed first.

@luoluoyuyu luoluoyuyu force-pushed the fix-load-write-data-auth branch 2 times, most recently from 2c0d324 to 8ae23f2 Compare July 9, 2026 04:07
Comment on lines +228 to +231
return USER_VALUE_MASK_PREFIX
+ Base64.getUrlEncoder()
.withoutPadding()
.encodeToString(value.getBytes(StandardCharsets.UTF_8));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use Base32 since some file systems are case-insensitive,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

break;
case USER_KEY:
if (value == null || value.isEmpty()) {
throw new SemanticException("User name must not be empty");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

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.

3 participants