Skip to content

[fix](be) Keep credentials out of fragment execution logs - #69540

Open
OIiveirra wants to merge 1 commit into
apache:masterfrom
OIiveirra:fix/jira-sdbsec-254
Open

OIiveirra wants to merge 1 commit into
apache:masterfrom
OIiveirra:fix/jira-sdbsec-254

Conversation

@OIiveirra

@OIiveirra OIiveirra commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Problem Summary: FragmentMgr prints complete pipeline execution parameters at VLOG(10), including file-scan properties, descriptor passwords and transaction tokens. The external open path also prints a complete query plan at VLOG(1). Replace these dumps with query/fragment identifiers and instance counts without modifying execution parameters.

- Log complete execution parameters and external query plans
+ Log fixed identifiers and instance counts

Release note

Verbose fragment execution logs no longer include full execution parameters, query options or external query plans that may contain credentials.

Evidence

  • FragmentParamsLogTest.*:FragmentMgrLogTest.*: 5 executed, 5 passed, 0 failed, 0 skipped (Clang21/ASAN with the documented private legacy compatibility overlay). Fresh GTest XML and unchanged source inputs were checked.
  • Tests cover synthetic S3/token/password values, unknown property keys, unchanged execution parameters, and real pipeline/external request log capture with VLOG(10) enabled.
  • clang-format 16 and whitespace checks passed.
  • ASAN FE+BE build, GLIBC_2.17 artifact check, build hygiene and clang-tidy passed.
  • An isolated 1FE+3BE instance scanned a private MinIO CSV: 3 rows and SUM(id)=6, independently checked against the uploaded object. Native regression output generation and subsequent snapshot comparison both passed (1 suite each, no failures/skips).
  • All four real S3 query IDs matched the VLOG(10) fragment summaries; synthetic access/secret keys were absent from BE logs. Process identities remained unchanged during the test. The task-owned services were stopped afterwards.

Check List (For Author)

  • Test:
    • Unit Test: the five focused fragment log tests above.
    • Manual test: isolated S3 CSV scan, native snapshot comparison, and credential-log inspection.
  • Behavior changed:
    • Yes. Verbose diagnostics contain fixed identifiers and counts instead of full parameter dumps.
  • Does this need documentation?
    • No.

Merge Danger

Door: two-way

Blast Radius: diagnostics

Execution and protocol parameters are unchanged; only verbose log contents change.

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?

Problem Summary: At verbose log levels, FragmentMgr formats complete pipeline parameters and external query plans. File scan properties, table descriptors and transaction parameters can contain storage credentials, passwords or tokens. Replace these dumps with a shared summary of query and fragment identifiers and instance counts, and keep only identifiers in the external open log. Execution parameters remain unchanged.

### Release note

Verbose fragment execution logs no longer include full execution parameters, query options or external query plans that may contain credentials.

### Check List (For Author)

- Test: clang-format 16 and whitespace checks passed; focused BE unit tests and ASAN build are in progress
    - Unit Test: add synthetic credential coverage and capture both pipeline and external request logs
- Behavior changed: Yes; verbose diagnostics contain identifiers and counts instead of full parameter dumps
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@OIiveirra
OIiveirra marked this pull request as ready for review October 23, 2026 14:03
Copilot AI balanced review requested due to automatic review settings October 23, 2026 14:03
@OIiveirra

Copy link
Copy Markdown
Collaborator Author

run buildall

@OIiveirra

Copy link
Copy Markdown
Collaborator Author

/review

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot left a comment

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.

Reviewed #69540 at c17cf35 using the supplied aggregate diff and all five changed files. No actionable new findings were identified. There are no existing inline findings to retain as blockers. No additional user focus was supplied.

Checkpoint conclusions:

  1. Goal and correctness: the four FragmentMgr execution-parameter, query-options and external-plan dump statements are removed. The shared const formatter reads only numeric query/fragment IDs and the local-instance count, preserving execution inputs. Five unit tests cover exact output, default fields, nonmutation and synthetic credential omission, including the two production request paths.
  2. Scope and reuse: one formatter is shared by both execution summaries; changes remain limited to verbose logging and focused tests.
  3. Concurrency and locks: production adds no shared state or locks. Runtime test log capture protects its buffer with a mutex; teardown stops and joins FragmentMgr before removing the sink and restoring logging/debug-point configuration.
  4. Lifecycle and initialization: no new production static initializer, retained reference or resource owner. The fixture restores the state it changes; private ExecEnv construction follows the existing BE test configuration.
  5. Configuration: no configuration item added; the existing VLOG(10) and VLOG(1) levels are retained.
  6. Compatibility: no existing interface, execution/storage format, or OS/libc API changes. The generated type is forward-declared in the header and included in the implementation.
  7. Thrift/protobuf: no schema, field ID, enum value or requiredness changes; rolling-upgrade wire behavior is unchanged.
  8. Parallel paths: ordinary and callback RPC dispatch, transactional/direct callers and external scanner requests reach the updated core logging path. External open retains query/instance IDs and upstream original/new-query correlation.
  9. Conditional checks and errors: no production branch or Status handling changes; the tests intentionally stop at the existing pre-context failure hook after request logging.
  10. Test coverage: CMake automatically includes both new test files. Tests inspect known and unknown scan-property values, descriptor credentials, transaction tokens, counts, defaults and parameter equality. Runtime capture reaches the changed pipeline and external log sites.
  11. Expected results: exact summary assertions agree with numeric ID formatting and local-instance counts; no regression output files are changed. Tests were inspected, not run during this review.
  12. Observability: query/fragment/count summaries and external instance correlation remain available. Removing full parameters and options intentionally reduces verbose detail; no new execution path requires metrics.
  13. Transactions and persistence: transaction state, version visibility, delete bitmaps, metadata persistence and failover logic are unchanged.
  14. Writes and atomicity: no data-write, commit or cleanup behavior changes.
  15. FE/BE variables: no new transmitted variable or sending-point update.
  16. Performance and memory: bounded scalar formatting replaces recursive request serialization and remains lazily evaluated inside VLOG; no significant retained allocation or new memory-accounting path.
  17. Other review obligations: no new cache/factory ownership, nullable-column handling, cross-TU initialization, template instantiation, source-file inclusion or build-gate exception. No further introduced issue found after the missed-issue recheck.

Limits: this was a static review; no builds, tests, sanitizers, end-to-end scans or final ELF audits were executed, and the PR author's runtime evidence was not independently reproduced. The runtime assertions would not detect reintroducing only the separate query-options dump because they do not place a marker in query_options; the current source does remove that dump. An unchanged HTTP stream-load parameter dump remains outside this FragmentMgr-specific change. No unresolved candidate or uncovered changed-file scope remains.

Review converged after 2 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28429 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit c17cf357b5610b339a89d648aaf324ff2b0f63e8, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17596	5143	5049	5049
q2	2158	330	265	265
q3	10200	1379	829	829
q4	4677	475	332	332
q5	7441	801	528	528
q6	179	184	148	148
q7	744	793	599	599
q8	9254	1276	1116	1116
q9	5491	4184	4175	4175
q10	6830	1290	1031	1031
q11	422	242	227	227
q12	642	398	284	284
q13	18114	3561	3003	3003
q14	267	272	249	249
q15	q16	734	702	657	657
q17	1190	742	563	563
q18	6969	6158	6095	6095
q19	1108	976	600	600
q20	379	337	222	222
q21	5326	2198	2258	2198
q22	344	297	259	259
Total cold run time: 100065 ms
Total hot run time: 28429 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5576	5580	5589	5580
q2	673	562	545	545
q3	5241	5369	4933	4933
q4	1990	2177	1558	1558
q5	5289	5135	5586	5135
q6	263	201	159	159
q7	2297	2049	1852	1852
q8	2961	2684	2630	2630
q9	8079	7962	7885	7885
q10	3697	3733	3241	3241
q11	766	429	398	398
q12	685	706	534	534
q13	3506	3827	3222	3222
q14	323	335	304	304
q15	q16	703	713	675	675
q17	8208	7431	6830	6830
q18	13002	12192	12835	12192
q19	907	764	765	764
q20	2134	2141	1923	1923
q21	5562	4590	4651	4590
q22	490	452	418	418
Total cold run time: 72352 ms
Total hot run time: 65368 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 150400 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit c17cf357b5610b339a89d648aaf324ff2b0f63e8, data reload: false

query5	4309	588	434	434
query6	427	205	189	189
query7	4799	443	230	230
query8	315	170	151	151
query9	8748	3104	3113	3104
query10	451	323	247	247
query11	5989	3854	3556	3556
query12	138	89	89	89
query13	1234	450	326	326
query14	6123	3907	3664	3664
query14_1	3419	3408	3424	3408
query15	202	192	172	172
query16	926	441	393	393
query17	838	623	519	519
query18	2397	430	300	300
query19	188	149	127	127
query20	81	80	81	80
query21	203	128	104	104
query22	13058	13005	12810	12810
query23	13463	12877	12368	12368
query23_1	12562	12579	12477	12477
query24	7387	831	447	447
query24_1	460	462	465	462
query25	507	400	331	331
query26	1263	251	133	133
query27	2787	435	272	272
query28	4610	1916	1950	1916
query29	1547	594	461	461
query30	316	224	184	184
query31	1019	923	827	827
query32	138	89	90	89
query33	520	315	247	247
query34	887	848	504	504
query35	751	757	647	647
query36	810	786	730	730
query37	126	99	80	80
query38	1787	1745	1676	1676
query39	789	801	753	753
query39_1	741	725	748	725
query40	233	116	101	101
query41	73	68	68	68
query42	97	87	84	84
query43	350	368	313	313
query44	1337	690	689	689
query45	180	192	172	172
query46	823	965	583	583
query47	2949	3003	2689	2689
query48	298	311	224	224
query49	588	404	301	301
query50	657	293	211	211
query51	10555	10188	10362	10188
query52	81	79	73	73
query53	196	206	156	156
query54	249	198	184	184
query55	74	69	68	68
query56	238	235	220	220
query57	1673	1621	1592	1592
query58	293	271	263	263
query59	2120	2164	1995	1995
query60	296	253	241	241
query61	172	166	165	165
query62	386	342	309	309
query63	193	164	166	164
query64	2800	913	750	750
query65	3342	3289	3255	3255
query66	1772	435	305	305
query67	19851	20153	19897	19897
query68	2977	990	619	619
query69	401	285	239	239
query70	854	781	746	746
query71	296	239	207	207
query72	2689	2568	2302	2302
query73	530	516	292	292
query74	4632	4531	4370	4370
query75	2331	2289	1923	1923
query76	2317	1024	595	595
query77	343	366	275	275
query78	9768	9699	9188	9188
query79	1002	890	512	512
query80	549	410	357	357
query81	553	326	270	270
query82	590	132	105	105
query83	304	193	178	178
query84	318	120	105	105
query85	850	424	369	369
query86	334	241	230	230
query87	2020	1940	1812	1812
query88	3694	2685	2670	2670
query89	334	279	237	237
query90	1892	173	171	171
query91	200	152	132	132
query92	96	87	84	84
query93	1000	997	560	560
query94	447	324	267	267
query95	571	393	302	302
query96	659	493	231	231
query97	2468	2439	2333	2333
query98	162	158	153	153
query99	769	773	642	642
Total cold run time: 233926 ms
Total hot run time: 150400 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.27 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit c17cf357b5610b339a89d648aaf324ff2b0f63e8, data reload: false

query1	0.01	0.01	0.01
query2	0.10	0.04	0.04
query3	0.26	0.08	0.09
query4	1.61	0.10	0.10
query5	0.23	0.24	0.24
query6	1.19	0.68	0.67
query7	0.04	0.01	0.01
query8	0.06	0.03	0.04
query9	0.41	0.36	0.35
query10	0.63	0.57	0.59
query11	0.20	0.14	0.14
query12	0.18	0.14	0.14
query13	0.49	0.50	0.49
query14	1.02	1.02	1.00
query15	0.62	0.61	0.61
query16	0.36	0.34	0.34
query17	1.18	1.13	1.12
query18	0.21	0.18	0.22
query19	2.08	2.01	2.07
query20	0.01	0.01	0.01
query21	15.48	0.20	0.13
query22	4.95	0.06	0.05
query23	16.28	0.32	0.12
query24	2.89	0.86	0.37
query25	0.12	0.07	0.04
query26	1.59	0.22	0.15
query27	0.06	0.05	0.03
query28	2.63	0.66	0.38
query29	12.53	4.22	3.27
query30	0.29	0.13	0.10
query31	2.77	0.56	0.32
query32	3.23	0.59	0.51
query33	3.14	3.27	3.22
query34	15.31	4.02	3.35
query35	3.36	3.34	3.31
query36	0.54	0.43	0.42
query37	0.10	0.06	0.07
query38	0.04	0.04	0.03
query39	0.04	0.03	0.03
query40	0.17	0.15	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.04
Total cold run time: 96.58 s
Total hot run time: 24.27 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 66.59% (31993/48048)
Line Coverage 51.40% (337567/656796)
Region Coverage 46.77% (273210/584150)
Branch Coverage 48.49% (128728/265480)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.28% (35977/46553)
Line Coverage 62.59% (406670/649759)
Region Coverage 59.06% (343754/582040)
Branch Coverage 59.99% (158885/264831)

yiguolei pushed a commit that referenced this pull request Oct 24, 2026
#69543)

### What problem does this PR solve?

Related PR: #69540

Problem Summary: FragmentMgr prints complete pipeline execution
parameters at VLOG(10), including file-scan properties, descriptor
passwords and transaction tokens. The external open path also prints a
complete query plan at VLOG(1). Replace these dumps with query/fragment
identifiers and instance counts without modifying execution parameters.

```diff
- Log complete execution parameters and external query plans
+ Log fixed identifiers and instance counts
```

### Release note

Verbose fragment execution logs no longer include full execution
parameters, query options or external query plans that may contain
credentials.

### Evidence

- `FragmentParamsLogTest.*:FragmentMgrLogTest.*`: **5 executed, 5
passed, 0 failed, 0 skipped** (Clang21/ASAN). Fresh GTest XML and
unchanged source inputs were checked.
- Tests cover synthetic S3/token/password values, unknown property keys,
unchanged execution parameters, and real pipeline/external request log
capture with VLOG(10) enabled.
- clang-format 16 and whitespace checks passed.
- Task-private build selection retained the two requested test files,
native initialization/link support, and complete branch BE libraries.
This validates the selected tests; full native UT and regression groups
were not run.

### Check List (For Author)

- Test:
    - [x] Unit Test: the five focused fragment log tests above.
- Behavior changed:
- [x] Yes. Verbose diagnostics contain fixed identifiers and counts
instead of full parameter dumps.
- Does this need documentation?
    - [x] No.

### Merge Danger

**Door:** two-way

**Blast Radius:** diagnostics

Execution and protocol parameters are unchanged; only verbose log
contents change.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants