Repository navigation
[fix](hudi) Keep storage credentials out of scanner logs (branch-4.2) - #69479
Conversation
### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: Hudi JNI scanners logged every input parameter value at DEBUG, including explicit S3A access keys, secret keys and session tokens. Log parameter names and the query ID separately while preserving the Hadoop configuration used to read data. Add a regression test that captures DEBUG output, checks that query IDs remain available, rejects bucket-specific and custom credential values, and verifies that the scanner retains the original Hadoop properties. ### Release note Hudi JNI scanner debug logs no longer record storage credential values and continue to include query IDs for diagnostics. ### Check List (For Author) - Test: Unit Test - 9 targeted Hudi parameter-log, column-value and UUID tests pass. Maven validate / Checkstyle and git diff --check pass. - Behavior changed: Yes - scanner debug logs show parameter names and the query ID without storage credentials. - Does this need documentation: No
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
FE Regression Coverage ReportIncrement line coverage |
|
run cloud_p0 |
|
/review |
There was a problem hiding this comment.
Reviewed the complete two-file PR diff at 6463c9a. No actionable introduced defects found. The review converged in one round: the complete-review agent and separate credential-provenance risk agent both returned NO_NEW_VALUABLE_FINDINGS, and all candidates and risk items have evidence-backed dispositions.
The constructor logs parameter names and the runtime-generated query ID while omitting other parameter values. I traced HudiScanNode properties through both legacy and format_v2 BE JNI readers, JNI map transport, scanner construction, authentication, reader Properties and JobConf. Both callers generate the query ID from numeric runtime fields; catalog properties cannot overwrite that raw parameter. Hadoop credential values retain their original downstream configuration flow.
Individual critical checkpoint conclusions:
- Goal and test: the added test captures the real scanner category, requires DEBUG visibility, checks query/key output, rejects ordinary and bucket-specific S3A access/secret/session values plus a custom token, and compares the exact Hadoop map. Static inspection supports the intended constructor logging fix.
- Scope: the production change is limited to two logging statements, with one focused regression test.
- Concurrency and locks: no new production thread, shared mutable state or lock ordering; test capture uses a thread-safe list and scoped logger settings. No competing logger mutation was identified in this module's tests.
- Lifecycle and initialization: no new production static initialization dependency or retained resource; capture cleanup removes appenders and restores saved settings even on assertion failure. The constructor-only test opens no reader or native vector table.
- Configuration: no new setting or dynamic-configuration behavior; original Hadoop values still populate fsOptionsProps.
- Compatibility: constructor interfaces, function symbols, protocols and storage formats are preserved; an absent query ID is safe to format.
- Thrift/protobuf: no definition changes requiring cross-release field/enum checks.
- Parallel paths: both legacy and format_v2 JNI readers share this Java scanner and receive the fix. Native reader paths are unaffected.
- Conditions: existing prefix extraction and DEBUG guard remain valid; the query-ID message uses parameterized logging.
- Coverage: positive diagnostics, multiple credential families, arbitrary Hadoop values and configuration preservation are covered by assertions. Inherited Log4j APIs and JUnit Vintage support the test's dependencies; existing constructor tests remain compatible by inspection.
- Expected results: no generated output files changed; no build or test result is independently claimed here.
- Observability: query correlation and parameter names remain available at DEBUG. The local logging change requires no new metric or INFO event.
- Persistence and failover: no EditLog, transaction, replay, visibility-version or failover behavior changes.
- Writes and crash behavior: no data-write or atomicity change; existing reader exception/close behavior is preserved.
- FE/BE variables: no new transmitted variable; both BE builders already supply query_id.
- Performance and memory: the parameter loop remains linear; one constant-time map lookup/DEBUG event is added, and parameter values are no longer formatted. No significant new allocation or tracking concern found.
- Further recheck: verified property-name/query-ID collisions, missing IDs, logging bridge/capture behavior, authenticator side effects, remaining scanner logs and alternate JNI callers. No additional introduced issue remained; data/version/delete-bitmap invariants are unaffected.
There were no existing inline threads or additional user focus points. There are no accepted inline findings, existing blocking comment IDs, unresolved candidates or uncovered changed files. Validation is static-only as required: builds, unit tests and live S3/Kerberos/end-to-end scans were not run. This conclusion concerns the changed constructor parameter logging, without asserting that third-party or pre-existing exception logs are scrubbed.
Review converged after 1 round(s).
FE Regression Coverage ReportIncrement line coverage |
### What problem does this PR solve? Issue Number: N/A Related PR: #69479 (branch-4.2), #69480 (branch-4.1), #69481 (branch-3.1) Problem Summary: When a Hudi JNI scan uses explicit S3A credentials, enabling scanner DEBUG logging prints every parameter value, including access keys, secret keys and session tokens. Log parameter names without values and record the query ID separately so scans remain traceable. The Hadoop configuration used to read data is unchanged. Add a regression test that captures the real scanner's DEBUG output, checks that parameter names and the query ID remain visible, rejects ordinary and bucket-specific credentials and custom tokens, and verifies that Hadoop properties retain their original values. ### Release note Hudi JNI scanner debug logs no longer include storage credential values and continue to include query IDs for diagnostics. ### Check List (For Author) - Test - [ ] Regression test - [x] Unit Test - [ ] Manual test - [ ] No need to test or manual test. Validation with JDK 17: - `./run-fe-ut.sh --run 'org.apache.doris.hudi.HadoopHudiJniScannerLogTest,org.apache.doris.hudi.HadoopHudiPluginTest,org.apache.doris.hudi.HadoopHudiColumnValueTest'`: 16 tests passed. - The new log test fails on the original code because parameter values appear in DEBUG output and passes after the fix. - The existing plugin test writes and reads a local Hudi table through the Java scanner. - Maven `validate` / Checkstyle for `be-java-extensions/hadoop-hudi-scanner` and its dependencies, plus `git diff --check`: passed. - The logging regression is covered directly by JUnit. FE/BE + S3 end-to-end regression was not run locally; SQL planning, credential propagation and data-reading logic are unchanged. - Behavior changed: - [ ] No. - [x] Yes. DEBUG logs retain parameter names and query IDs without printing other parameter values. - Does this need documentation? - [x] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label
What problem does this PR solve?
Issue Number: N/A
Related PR: #69478 (backport to branch-4.2)
Problem Summary: When a Hudi JNI scan uses explicit S3A credentials, enabling scanner DEBUG logging prints every parameter value, including access keys, secret keys and session tokens. Log parameter names without values and record the query ID separately so scans remain traceable. The Hadoop configuration used to read data is unchanged.
Add a regression test that captures the real scanner's DEBUG output, checks that parameter names and the query ID remain visible, rejects ordinary and bucket-specific credentials and custom tokens, and verifies that Hadoop properties retain their original values.
Release note
Hudi JNI scanner debug logs no longer include storage credential values and continue to include query IDs for diagnostics.
Check List (For Author)
Test
Validation with JDK 17:
EXTRA_FE_MODULES=hudi=be-java-extensions/hadoop-hudi-scanner ./run-fe-ut.sh --run 'org.apache.doris.hudi.HadoopHudiJniScannerLogTest,org.apache.doris.hudi.HadoopHudiColumnValueTest,org.apache.doris.hudi.HudiUuidTransportTest': 9 tests passed.validate/ Checkstyle forbe-java-extensions/hadoop-hudi-scannerand its dependencies, plusgit diff --check: passed.Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)