Skip to content

[fix](iceberg) Harden external-write lifecycle, OCC, memory, and file ownership - #66348

Merged
Gabriel39 merged 29 commits into
apache:masterfrom
Gabriel39:fix/iceberg-write-safety
Aug 14, 2026
Merged

[fix](iceberg) Harden external-write lifecycle, OCC, memory, and file ownership#66348
Gabriel39 merged 29 commits into
apache:masterfrom
Gabriel39:fix/iceberg-write-safety

Conversation

@Gabriel39

@Gabriel39 Gabriel39 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary:

Iceberg and Hive external writes had correctness and resource-safety gaps across statement lifecycle, optimistic concurrency, asynchronous memory ownership, multipart publication, final-report ownership transfer, and orphan cleanup.

This PR:

  • brings pre-execution failures into the normal rollback scope while keeping post-commit refresh and listener failures from turning a durable external commit into a retryable statement failure;
  • binds row-level DML and overwrite writes to the exact read snapshot and branch, including the empty-table generation across transaction refresh, and validates concurrent changes before commit. For Iceberg INSERT OVERWRITE, a concurrent DELETE or MERGE now makes the overwrite fail instead of silently losing the concurrent change; ordinary append INSERT INTO behavior is unchanged;
  • transfers asynchronous reservations with queued blocks, releases every reservation on terminal writer paths, accounts for all partition sorters using safe row/byte bounds from the actual incoming block, reserves cold partition dispatch and final spill-merge workspace, and saturates reservation arithmetic instead of allowing overflow;
  • propagates partition-writer close failures, uses compact row permutations for partition dispatch, and preserves configurable Iceberg metrics behavior;
  • emits Hive, Iceberg, and MaxCompute ownership vectors only in the final report, validates that complete report against the smaller FE/BE Thrift limit, and transfers ownership only after coordinator acceptance;
  • reports deferred Hive upload identities only in the final ownership vector so FE performs transactional rollback cleanup; uploads that never reach FE are left to provider lifecycle policies, while Hive validation or classification failures still self-roll back;
  • gates Iceberg table and standalone DELETE file production on coordinator report-ack support before file creation;
  • publishes Azure multipart data atomically with exact staged block IDs namespaced by a locally generated writer UUID, without target leases, and fails closed if a competing same-key writer commits first;
  • implements remove_orphan_files with retained-snapshot reachability, explicit retention and safety limits, deduplicated scans, fail-closed handling for unknown or non-positive creation times, and fail-closed ownership for shared external roots unless an explicit verified location is supplied.

Release note

Harden Iceberg and Hive external-write lifecycle, OCC conflict detection, memory admission, multipart publication, final-report ownership transfer, and orphan-file safety.

Testing

  • HiveConnectorTransactionTest: 17 passed, including validation/classification self-rollback and malformed-record isolation.

  • Iceberg connector focused suites: 295 passed after rebasing onto the latest Iceberg V3 changes.

  • Azure filesystem extension suite: 21 passed.

  • FE report acknowledgement, task-state, sink-binding, and insert-executor focused suites: 30 passed.

  • Earlier BE ASAN focused suites covered final-only report ownership, standalone DELETE ACK gating, active writer snapshots, and upstream missing-partition-source validation; the latest UUID update compiled all affected BE production and test objects.

  • External-file report lifecycle tests cover successful Hive close, periodic metadata deferral, and exact final pending-upload identity without BE provider abort ownership.

  • Sorted-write admission and ownership verification: 29/29 ASAN tests passed, covering multi-partition row/byte bounds, cold writer dispatch, reservation overflow, async write/EOS transfer, terminal cleanup, real spill fan-in, real 128-partition selection.

  • All pre-existing branch commits remained patch-equivalent after rebasing onto master.

  • Header self-containment compile verification: all four affected ANN translation units, RuntimeState, and PipelineFragmentContext passed ASAN syntax-only compilation after adding the missing Thrift forward declaration.

  • All changed BE C/C++ files passed the repository clang-format v16 check; the latest 12-file update also passed clang-format v16 dry-run and git diff --check.

  • Latest review-gap verification: QeProcessorImplReportAckTest passed 7/7, IcebergRemoveOrphanFilesActionTest passed 13/13, and the ASAN RuntimeStateIcebergCommitDataTest suite passed 7/7. Mutation checks failed when the timestamp and ambiguous-ownership guards were removed, then passed after the fixes were restored.

  • The three affected BE files passed the repository clang-format 16 check; the final diff passed git diff --check and the FE reactor completed Checkstyle with 0 violations.

  • FE Checkstyle completed with 0 violations.

  • Latest Azure UUID update: AzureObjStorageExtensionTest passed 21/21; Azure BE production and test objects compiled with USE_AZURE enabled; clang-format v16 and git diff --check passed. Clang-tidy remained blocked by repository/toolchain baseline errors in types.h and the missing system stddef.h.

  • Connector forbidden-import architecture gate passed.

  • Focused clang-tidy found and fixed the changed sorter warning; full translation-unit analysis remains blocked by repository-baseline unconditional static assertions in be/src/util/jni-util.h.

  • Regression framework MTMV job lookup: the targeted test failed with the old cross-MV status query and passed with the isolated jobs metadata query; all 4 framework tests passed, with Java and Groovy compilation successful.

  • Iceberg merge sink BE UT: reproduced 12/14 failures with a mock coordinator missing report-ACK capability; after modeling an ACK-capable coordinator, all 14 merge sink tests passed, and the separate no-ACK fail-closed test also passed (15/15 focused ASAN tests).

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes. External writes now fail closed on concurrency, protocol, report-size, same-key multipart conflicts, and ownership uncertainty; durable commits are not retried because of post-commit refresh failures; Iceberg sorted-write admission is bounded by the actual input while preserving cumulative growth safety.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@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?

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@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.

Requesting changes: the static review found nine actionable issues (six P1, three P2), including three paths that can delete or reference missing Iceberg data, a concurrent use-after-free, an aggregate Thrift limit bypass, pathological spill reservation, and two incomplete object-storage cleanup paths.

Critical checkpoint conclusions:

  1. Goal and proof: The PR partially hardens write/cleanup/OCC behavior, and the overwrite and external-insert lifecycle changes are credible, but the nine inline findings prevent the stated lifecycle and cleanup goals from being met. Added tests prove only narrow single-state, AWS-abort, permutation, and executor cases.
  2. Scope and clarity: The edits are generally focused, but the new destructive action reimplements Iceberg safety policy incompletely, and the provider-neutral abort surface is implemented with AWS-specific state.
  3. Concurrency: The async writer publishes active-writer snapshots while a separately scheduled revocation task reads them. Per-writer _sorter_mutex locking is consistent and no deadlock was found, but it cannot protect the snapshot container because the range-for drops its temporary owner before iteration (MAIN-BE-003).
  4. Lifecycle: Sort-writer close/cancel/deferred cleanup and external commit/listener ordering were traced end to end and otherwise preserve error ownership. S3/Azure abort lifecycle is incomplete: a rejected abort is never retried, and Azure reports successful abandonment without provider cleanup (MAIN-IO-001/002).
  5. Configuration: No new configuration was added. Existing thrift_max_message_size and S3 limiter settings are read dynamically, but their consumers do not enforce the correct aggregate/cleanup contracts.
  6. Compatibility: No storage-format or wire-field change was introduced. Default virtual methods preserve source-level parallel implementations, but that default is exactly why Azure silently lacks the new cleanup behavior.
  7. Parallel paths: Static/dynamic/branch/empty overwrites, data/delete writers, sync/async/destructor close, S3/Azure providers, and all insert executors were checked. The accepted findings identify the paths where parity is missing.
  8. Conditional checks: Existing overwrite conflict conditions are sound. The orphan action is missing the required gc.enabled fence, safe retention interval, canonical URI identity handling, and version-hint reachability.
  9. Test coverage: Coverage is not comprehensive. Missing cases include multi-task aggregate reports, concurrent snapshot publication/traversal, many-partition reserve accounting, hard-limit abort rejection, Azure staged-block abort, and execution-level orphan deletion tests for GC, retention, URI aliases, and the version hint.
  10. Test results: The new assertions are logically consistent within their narrow scopes; no result files changed. Builds and tests were intentionally not run because the authoritative review prompt forbids them, so this conclusion is static-only.
  11. Observability: Existing timers/logs cover writer/spill/commit paths, and abort failures are warned. No additional standalone observability defect was found, but logging does not substitute for retained cleanup ownership or retry.
  12. Transaction and persistence: No Doris EditLog state is added. Iceberg overwrite OCC anchors for main/branch/empty/static/dynamic cases are sound, and the durable external commit marker precedes refresh/listener suppression. The orphan action can nevertheless race a concurrent external commit (MAIN-FE-004).
  13. Data writes and atomicity: The aggregate-report failure can strand uncommitted objects; unsafe orphan deletion can corrupt shared, aliased, or concurrent writes; and multipart cleanup can leak provider state. These are blocking write-lifecycle defects.
  14. FE/BE propagation: No new FE-BE variable or Thrift field is introduced. Existing commit metadata is propagated on every producer path, but its budget is enforced per task rather than on the final aggregated RPC (MAIN-BE-001).
  15. Performance: Compact permutation dispatch is semantically sound, and bounded snapshot-copy cost is not independently material. Summing one full-batch reserve estimate per active partition can request roughly 128 blocks and repeatedly spill tiny partitions (MAIN-BE-002).
  16. Other issues: Error precedence, close idempotence, spill cleanup, overwrite validation, permission checks, location containment, and post-commit listener behavior produced no additional substantiated defects.

User focus: review_focus.txt contained no additional focus guidance, so the whole PR was reviewed without a narrower focus.

Review status: complete and converged in round 3. All final full-scope and risk-focused reviewers returned NO_NEW_VALUABLE_FINDINGS for this exact comment set. Static review only; no builds or tests were run.

Comment thread be/src/exec/pipeline/pipeline_fragment_context.cpp Outdated
Comment thread be/src/exec/operator/spill_iceberg_table_sink_operator.cpp Outdated
Comment thread be/src/exec/operator/spill_iceberg_table_sink_operator.cpp Outdated
Comment thread be/src/io/fs/rate_limited_obj_storage_client.cpp Outdated
Comment thread be/src/io/fs/s3_file_writer.cpp Outdated
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 18.75% (3/16) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17724	4095	4036	4036
q2	2006	335	200	200
q3	10328	1369	813	813
q4	4688	483	343	343
q5	7525	844	555	555
q6	187	170	136	136
q7	771	784	599	599
q8	9346	1605	1623	1605
q9	5334	4112	4083	4083
q10	6769	1631	1355	1355
q11	501	357	331	331
q12	709	575	454	454
q13	18114	3320	2756	2756
q14	260	262	247	247
q15	q16	748	732	654	654
q17	928	919	987	919
q18	6906	5853	5666	5666
q19	1360	1268	1053	1053
q20	808	657	605	605
q21	6000	2578	2390	2390
q22	447	364	307	307
Total cold run time: 101459 ms
Total hot run time: 29107 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4319	4280	4276	4276
q2	297	314	215	215
q3	4535	4912	4383	4383
q4	2217	2258	1414	1414
q5	4276	4138	4121	4121
q6	231	176	130	130
q7	1706	1595	1391	1391
q8	2231	1955	1892	1892
q9	6827	6773	6754	6754
q10	4263	4253	3830	3830
q11	524	388	404	388
q12	715	711	510	510
q13	2979	3259	2765	2765
q14	292	304	261	261
q15	q16	670	693	607	607
q17	1268	1234	1237	1234
q18	7298	7009	6779	6779
q19	1072	1049	1074	1049
q20	2214	2232	1943	1943
q21	5323	4580	4471	4471
q22	524	469	423	423
Total cold run time: 53781 ms
Total hot run time: 48836 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 169793 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 6ebd31859839dabd9ae88df95c3c1834ed99d722, data reload: false

query5	3980	613	479	479
query6	476	231	217	217
query7	4824	562	336	336
query8	325	179	163	163
query9	8513	4033	4021	4021
query10	454	357	299	299
query11	5709	2212	1980	1980
query12	150	100	99	99
query13	1266	608	412	412
query14	5318	4673	4396	4396
query14_1	3834	3792	3774	3774
query15	201	193	182	182
query16	1031	490	457	457
query17	868	679	542	542
query18	2574	470	345	345
query19	205	194	156	156
query20	104	107	106	106
query21	175	161	134	134
query22	13035	12884	12868	12868
query23	17358	16425	16089	16089
query23_1	16147	16100	16089	16089
query24	7499	1666	1250	1250
query24_1	1249	1255	1238	1238
query25	565	457	387	387
query26	1228	360	215	215
query27	2592	634	373	373
query28	4442	2056	2026	2026
query29	1125	631	496	496
query30	348	267	226	226
query31	1134	1082	950	950
query32	120	64	60	60
query33	565	326	248	248
query34	1178	1116	599	599
query35	735	744	637	637
query36	798	780	686	686
query37	158	112	96	96
query38	1867	1659	1609	1609
query39	824	830	825	825
query39_1	770	783	787	783
query40	249	163	153	153
query41	69	70	71	70
query42	96	95	94	94
query43	314	323	273	273
query44	1405	760	768	760
query45	201	175	171	171
query46	1045	1189	718	718
query47	1551	1539	1399	1399
query48	394	419	302	302
query49	591	418	305	305
query50	1033	450	344	344
query51	10626	10576	10510	10510
query52	86	89	77	77
query53	272	281	202	202
query54	288	249	244	244
query55	78	73	70	70
query56	322	322	317	317
query57	1010	1003	923	923
query58	316	259	254	254
query59	1506	1604	1352	1352
query60	341	269	255	255
query61	146	152	150	150
query62	396	318	264	264
query63	242	196	198	196
query64	2828	1033	855	855
query65	3868	3841	3860	3841
query66	1802	471	355	355
query67	28286	28254	28153	28153
query68	3061	1582	1060	1060
query69	405	311	273	273
query70	898	787	811	787
query71	379	330	308	308
query72	3025	2617	2290	2290
query73	853	856	415	415
query74	4591	4485	4297	4297
query75	2345	2356	1997	1997
query76	2335	1112	746	746
query77	329	361	276	276
query78	11206	11081	10586	10586
query79	1392	1191	741	741
query80	1270	541	454	454
query81	559	322	283	283
query82	563	148	116	116
query83	425	320	292	292
query84	322	157	129	129
query85	1011	607	529	529
query86	430	227	224	224
query87	1806	1795	1693	1693
query88	3690	2833	2795	2795
query89	399	315	289	289
query90	1781	200	187	187
query91	198	190	159	159
query92	66	61	59	59
query93	1720	1542	943	943
query94	711	346	310	310
query95	769	491	487	487
query96	1039	777	347	347
query97	2447	2443	2335	2335
query98	208	197	189	189
query99	719	718	611	611
Total cold run time: 249432 ms
Total hot run time: 169793 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.09	0.05	0.06
query3	0.25	0.13	0.13
query4	1.61	0.14	0.14
query5	0.24	0.22	0.23
query6	1.16	0.84	0.81
query7	0.04	0.01	0.00
query8	0.06	0.04	0.04
query9	0.38	0.32	0.32
query10	0.58	0.59	0.58
query11	0.19	0.13	0.13
query12	0.18	0.15	0.15
query13	0.45	0.48	0.48
query14	1.01	1.00	1.00
query15	0.59	0.59	0.58
query16	0.30	0.34	0.31
query17	1.11	1.12	1.14
query18	0.21	0.19	0.20
query19	2.05	1.89	1.96
query20	0.02	0.02	0.01
query21	15.42	0.21	0.13
query22	4.89	0.05	0.06
query23	16.12	0.31	0.13
query24	2.91	0.43	0.32
query25	0.11	0.05	0.05
query26	0.71	0.20	0.14
query27	0.04	0.03	0.03
query28	3.52	0.79	0.32
query29	12.49	4.03	3.20
query30	0.27	0.16	0.15
query31	2.76	0.55	0.32
query32	3.23	0.58	0.49
query33	3.20	3.26	3.14
query34	15.57	4.13	3.29
query35	3.25	3.20	3.22
query36	0.55	0.44	0.45
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.14	0.15
query41	0.07	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 96.07 s
Total hot run time: 23.92 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 40.29% (83/206) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.17% (25636/43323)
Line Coverage 43.24% (257196/594852)
Region Coverage 38.91% (203842/523919)
Branch Coverage 40.27% (93046/231076)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 68.45% (141/206) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.68% (31980/42255)
Line Coverage 60.31% (356346/590877)
Region Coverage 56.86% (298902/525687)
Branch Coverage 58.28% (134698/231114)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 18.75% (3/16) 🎉
Increment coverage report
Complete coverage report

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Aug 1, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66348

Problem Summary: Parallel Iceberg sink tasks could exceed the shared report limit, partition writers could over-reserve memory or outlive a temporary snapshot, failed multipart uploads could skip mandatory cleanup, and orphan-file deletion lacked Iceberg safety fences. Share the report budget, retain writer snapshots, bound reservations, make abort cleanup provider-aware, and enforce safe canonical orphan detection.

### Release note

Improve Iceberg write failure cleanup and orphan-file deletion safety.

### Check List (For Author)

- Test: Unit Test
    - BE ASAN focused tests with Azure support enabled
    - Full fe-connector-iceberg unit test suite
- Behavior changed: Yes, unsafe orphan cutoffs and GC-disabled deletion are rejected, and failed multipart uploads are cleaned up reliably.
- Does this need documentation: No
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@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.

Request changes: two distinct issues remain after the current fixes: Azure abort can delete a valid pre-existing Put Blob object, and orphan-file reachability repeatedly scans inherited manifests with quadratic cost. I did not duplicate the existing review threads.

Critical checkpoint conclusions:

  • Goal and proof: The PR broadly hardens Iceberg write/cleanup lifecycle, OCC, reporting limits, and orphan cleanup, but the Azure data-preservation goal is not yet met. The added tests cover nominal cleanup and OCC paths, not the two cases below.
  • Scope and clarity: The changes are cohesive for the stated lifecycle work. The orphan action's hand-built reachability scan is the one area that should reuse Iceberg's unique-manifest approach.
  • Concurrency: Async writer publication is protected by retained shared snapshots and per-sorter locking; the shared report budget has a consistent lock order. Azure's committed-block test is not a valid ownership fence for an existing object.
  • Lifecycle: FE before-execution cleanup and post-commit error boundaries are sound, as are the reviewed nested writer close paths. Azure abort still destroys state it does not own.
  • Configuration: No new configuration behavior requires dynamic-reload handling.
  • Compatibility: No FE-BE or storage-format incompatibility was found. The changed Azure block-ID format has a bounded retry impact and did not survive as a separate finding.
  • Parallel paths: S3, Azure, single-shot, multipart, committer, overwrite, branch, static/dynamic overwrite, and delete/merge paths were traced; the surviving provider-specific issue is inline.
  • Conditional checks: GC, retention, URI containment, identity ambiguity, and overwrite validation checks are fail-closed. CommittedBlocks.empty() is the invalid special case.
  • Test coverage: Unit coverage is substantial but misses preservation of an existing Put Blob target and an append-heavy multi-snapshot reachability scan. No end-to-end result covers either.
  • Test results: No tests or builds were run because the authoritative review task is static-only; no generated result files were changed.
  • Observability: Existing status/log paths are adequate for the reviewed failures; no additional metric was required for a correctness conclusion.
  • Transactions and persistence: Iceberg overwrite OCC, including empty-table and branch anchors, is sound. No EditLog or master-failover persistence change is involved.
  • Data writes: Commit/report cleanup ownership is sound outside the Azure abort branch; that branch can lose previously committed data and blocks approval.
  • FE-BE variables: No new cross-version transmitted variable or missing propagation path was found.
  • Performance: Per-snapshot planFiles() causes the P2 quadratic manifest-read issue below; no other distinct hot-path issue survived duplicate suppression.
  • Other issues: The sorter aggregate-reservation concern remains covered by the existing thread, and cleanup admission/terminal-state concerns remain covered by the existing Azure/rate-limit threads, so they are not repeated here.

User focus: no additional user-provided focus was present; the full PR was reviewed.

Comment thread be/src/io/fs/azure_obj_storage_client.cpp Outdated
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 18.75% (3/16) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17734	4014	4200	4014
q2	2025	322	212	212
q3	10260	1426	849	849
q4	4715	473	338	338
q5	7659	840	558	558
q6	196	174	137	137
q7	733	813	590	590
q8	10415	1459	1590	1459
q9	5582	4080	4036	4036
q10	6807	1625	1362	1362
q11	527	346	342	342
q12	753	565	458	458
q13	18112	3337	2794	2794
q14	264	259	245	245
q15	q16	736	740	663	663
q17	1027	977	1049	977
q18	6986	5815	5492	5492
q19	1191	1315	1054	1054
q20	771	684	599	599
q21	5794	2661	2529	2529
q22	442	357	296	296
Total cold run time: 102729 ms
Total hot run time: 29004 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4429	4359	4262	4262
q2	281	319	211	211
q3	4560	4972	4362	4362
q4	2164	2256	1413	1413
q5	4304	4144	4124	4124
q6	229	176	129	129
q7	1695	1888	1731	1731
q8	2500	2078	2109	2078
q9	7351	7231	7252	7231
q10	4323	4277	3878	3878
q11	568	416	395	395
q12	739	749	509	509
q13	3253	3703	2962	2962
q14	317	307	276	276
q15	q16	726	738	647	647
q17	1372	1331	1262	1262
q18	7878	7307	7282	7282
q19	1099	1082	1087	1082
q20	2193	2208	1921	1921
q21	5323	4643	4500	4500
q22	534	454	406	406
Total cold run time: 55838 ms
Total hot run time: 50661 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 169560 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 1241244cc139a902b16c5f3ce1fea1335d4fa123, data reload: false

query5	4327	615	455	455
query6	475	228	202	202
query7	4911	575	348	348
query8	333	196	168	168
query9	8769	4044	4075	4044
query10	457	337	296	296
query11	5849	2196	2002	2002
query12	154	97	95	95
query13	1288	553	438	438
query14	6095	4702	4367	4367
query14_1	3857	3809	3803	3803
query15	215	204	179	179
query16	1011	475	466	466
query17	1133	738	541	541
query18	2438	460	331	331
query19	204	178	137	137
query20	108	100	98	98
query21	231	151	134	134
query22	13039	13083	12822	12822
query23	17152	16281	15998	15998
query23_1	16123	16080	16068	16068
query24	7462	1684	1224	1224
query24_1	1262	1261	1279	1261
query25	520	424	341	341
query26	1326	372	214	214
query27	2595	603	374	374
query28	4468	2023	2030	2023
query29	1022	586	464	464
query30	350	261	221	221
query31	1102	1069	935	935
query32	99	62	58	58
query33	512	307	241	241
query34	1166	1178	660	660
query35	751	748	641	641
query36	782	782	706	706
query37	153	105	95	95
query38	1833	1639	1612	1612
query39	812	808	797	797
query39_1	789	781	780	780
query40	247	163	142	142
query41	65	62	64	62
query42	101	94	93	93
query43	318	321	284	284
query44	1411	775	754	754
query45	184	169	169	169
query46	1024	1162	738	738
query47	1522	1508	1411	1411
query48	397	407	300	300
query49	588	403	294	294
query50	1010	418	329	329
query51	10784	10644	10642	10642
query52	87	94	76	76
query53	264	279	210	210
query54	301	257	236	236
query55	80	73	69	69
query56	319	316	302	302
query57	1004	997	921	921
query58	286	253	277	253
query59	1534	1600	1462	1462
query60	338	282	261	261
query61	175	167	169	167
query62	406	325	266	266
query63	232	203	205	203
query64	2932	1141	966	966
query65	3944	3830	3838	3830
query66	1828	497	376	376
query67	28341	28181	28062	28062
query68	3469	1491	926	926
query69	414	301	289	289
query70	911	821	799	799
query71	370	337	315	315
query72	3037	2617	2311	2311
query73	794	795	435	435
query74	4631	4474	4295	4295
query75	2392	2344	1999	1999
query76	2323	1150	724	724
query77	339	381	279	279
query78	11169	11189	10572	10572
query79	1364	1154	760	760
query80	1269	550	456	456
query81	517	327	280	280
query82	622	150	116	116
query83	365	320	298	298
query84	272	160	128	128
query85	970	599	524	524
query86	405	226	209	209
query87	1786	1801	1724	1724
query88	3737	2818	2788	2788
query89	395	317	289	289
query90	1893	201	200	200
query91	204	188	161	161
query92	60	61	56	56
query93	1663	1525	1002	1002
query94	719	368	314	314
query95	792	509	468	468
query96	1114	810	360	360
query97	2455	2457	2313	2313
query98	214	195	190	190
query99	724	723	612	612
Total cold run time: 256498 ms
Total hot run time: 169560 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.10	0.05	0.04
query3	0.26	0.14	0.13
query4	1.61	0.14	0.14
query5	0.24	0.23	0.22
query6	1.16	0.83	0.83
query7	0.03	0.01	0.01
query8	0.06	0.04	0.04
query9	0.39	0.32	0.33
query10	0.59	0.54	0.56
query11	0.19	0.14	0.14
query12	0.18	0.14	0.14
query13	0.47	0.46	0.46
query14	1.00	1.00	0.99
query15	0.60	0.59	0.58
query16	0.31	0.32	0.33
query17	1.07	1.08	1.08
query18	0.22	0.20	0.20
query19	2.03	2.01	1.95
query20	0.03	0.01	0.02
query21	15.46	0.24	0.13
query22	4.77	0.06	0.05
query23	16.12	0.31	0.12
query24	2.95	0.42	0.33
query25	0.11	0.06	0.04
query26	0.72	0.20	0.16
query27	0.05	0.03	0.04
query28	3.55	0.77	0.35
query29	12.47	4.07	3.19
query30	0.27	0.16	0.16
query31	2.78	0.54	0.31
query32	3.23	0.58	0.49
query33	3.22	3.16	3.26
query34	15.58	3.94	3.28
query35	3.24	3.23	3.24
query36	0.56	0.45	0.43
query37	0.10	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.17	0.16
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.15 s
Total hot run time: 23.98 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 36.68% (95/259) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.18% (25642/43332)
Line Coverage 43.24% (257265/594944)
Region Coverage 38.93% (203959/523957)
Branch Coverage 40.27% (93050/231088)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 59.46% (154/259) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.80% (32034/42263)
Line Coverage 60.46% (357286/590968)
Region Coverage 57.19% (300637/525724)
Branch Coverage 58.55% (135316/231126)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 18.75% (3/16) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 27.93% (50/179) 🎉
Increment coverage report
Complete coverage report

924060929
924060929 previously approved these changes Aug 10, 2026
yiguolei
yiguolei previously approved these changes Aug 10, 2026
Issue Number: None

Related PR: apache#66348

Problem Summary: Azure block uploads are scoped to a blob rather than a provider multipart session, while the BE abort path duplicated transaction cleanup ownership that belongs to FE. Generate a local UUID for each Azure writer, encode the full UUID in every block ID, and remove leases and the generic BE abort interface. Competing same-key writers now stage disjoint blocks; once one commits, a later stale block list fails closed.

None

- Test: Unit Test

    - AzureObjStorageExtensionTest: 21 tests passed

    - Affected BE production and test objects compiled successfully, including Azure with USE_AZURE enabled

    - Repository clang-format 16 check and git diff --check passed

    - FE reactor Checkstyle passed with 0 violations

    - clang-tidy was attempted but blocked by repository/toolchain baseline errors in types.h and missing system stddef.h

- Behavior changed: Yes, Azure multipart writers use local UUID block namespaces without leases, and BE no longer owns provider abort cleanup

- Does this need documentation: No
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@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.

Requesting changes for three additional P1 correctness gaps found after a full-scope review, duplicate suppression against all 102 existing inline comments, and two convergence rounds.

New blockers:

  • The transferred EOS reservation is released before Iceberg's real close() finalization performs sorting and spill merging.
  • EOS sizing ignores the mandatory sort of buffered data below the generic append thresholds.
  • An HMS lock timeout/RPC failure occurs before Hive's new self-rollback boundary, after the transaction manager has removed the rollback-capable owner.

Critical checkpoint conclusions:

  1. Goal and proof: The PR substantially hardens external-write OCC, report ownership, deferred upload publication, orphan deletion, and memory admission, but it does not fully accomplish the lifecycle/memory goal because the actual Iceberg finalization remains both unprotected and under-sized. The added tests exercise finish() and empty-sorter fan-in arithmetic, not the production close() and buffered-sort paths; the Hive tests also omit lock-acquisition failure after valid upload reports.
  2. Scope and clarity: The implementation is broad but mostly organized around the stated external-write lifecycle. The regression-framework MTMV lookup change is tangential, but its production schema and privilege path are consistent. No smaller local simplification removes the three blockers without repairing their lifecycle boundaries.
  3. Concurrency: The pipeline producer and fragment-manager writer coordinate through _m, queue admission, and the moved reservation token; sorter write/reserve/revoke/close operations serialize under _sorter_mutex, and active-writer snapshots retain shared ownership. No new deadlock or lock-order defect survived review. The remaining BE failures are reservation lifetime/size errors rather than unsynchronized access.
  4. Lifecycle: This is blocking. AsyncResultWriter ends the EOS reservation at finish() although Iceberg finalizes in close(). Separately, Hive loses the only cleanup-capable transaction owner before lock acquisition can fail. Error, cancellation, queue-drain, and non-OK close paths otherwise have concrete release/cleanup behavior.
  5. Configuration: No new mutable BE/FE configuration item requires dynamic propagation. Existing query options and Iceberg/Hive table properties are consumed at the expected statement/runtime boundaries.
  6. Compatibility: New optional Thrift fields and capability checks generally fail closed for Iceberg and Azure during rolling upgrades. Remaining Azure same-key/legacy residual-ID concerns are already covered by existing review threads and were not duplicated.
  7. Parallel paths and conditions: Classic Coordinator and Nereids/Load report paths, standalone delete/table/MERGE sinks, final versus periodic reports, explicit-empty Iceberg pins, named/default branches, and static/dynamic/unpartitioned overwrite paths were traced. No additional divergent path or unexplained special condition survived duplicate suppression.
  8. Tests and results: The PR adds substantial BE and FE unit coverage plus regression-framework coverage, but the three accepted negative cases are missing. No build or test was run in this review environment because the task prompt explicitly prohibited builds and code modifications; this review therefore does not claim execution results.
  9. Observability: New failure paths generally carry query/table/lock context and memory/report counters remain available. Logging is adequate for diagnosis; no separate metrics blocker was found.
  10. Transactions and persistence: Iceberg statement pins and overwrite/RowDelta conflict validation retain an OCC fence, and the orphan action fails closed on ownership ambiguity. No new EditLog state is introduced. Hive's pre-lock cleanup ownership gap is the remaining transaction-lifecycle blocker.
  11. Data writes and crash behavior: Report ACK state is monotonic after ambiguous delivery, and failed Iceberg close paths clean local files. The accepted Hive issue can leave valid S3 multipart uploads open without metadata publication; the accepted BE issues can cross a hard memory limit during successful EOS finalization instead of reserving/spilling first.
  12. FE/BE variables: External commit vectors, report ACK capability, Azure multipart capability, and exact block IDs are wired through the changed Thrift and sender/receiver paths. No missing additional send site was found.
  13. Performance and other issues: Row-permutation dispatch removes the prior partition filter cost, and active-writer aggregation avoids serial-workspace overcounting. The remaining performance/correctness concern is the accepted forced-sort reservation gap. One cold-writer allocation hypothesis was explicitly dismissed after tracing permute/insert_range_from to exact-size PODArray::resize rather than the 4 KiB push-growth floor.

User focus: no additional focus points were provided, so the entire PR was reviewed.

_writer_status.update(st);
}
if (reservation_held_for_finish) {
thread_context()->thread_mem_tracker_mgr->shrink_reserved();

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.

[P1] Keep the EOS reservation through the real Iceberg finalization. VIcebergTableWriter does not override finish() (the base implementation is a no-op); its partition writers run do_sort(), _do_spill(), and _combine_files_output() from close(), which is called only after this shrink_reserved(). Consequently the newly sized fan-in reservation is already gone when the merger allocates its cursors and blocks. Please release the token after close(st) on every path (ideally with an RAII guard), and make the async test observe the reservation inside close, not only an overridden finish.

Comment thread be/src/exec/sort/sorter.cpp Outdated
std::numeric_limits<size_t>::max()));
reserve.retained_growth_trigger_bytes = growth_trigger_bytes;
}
auto sort = new_rows > _buffered_block_size || new_block_bytes > _buffered_block_bytes;

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.

[P1] Include the forced EOS sort in this reservation. This method never uses eos and adds sort workspace only after the generic 4M-row/256 MiB append thresholds, but Iceberg close calls do_sort() for every nonempty sorter (or _do_spill(), which first sorts a pending run). A buffered sorter of tens of MiB below those thresholds can therefore reserve only the operator floor while sort_block keeps the source live and allocates the permutation plus a full permuted destination. The new fan-in test uses an empty sorter, so it misses both the no-spill and pending-run cases. Please size the actual EOS sort/serialization workspace and cover a buffered sorter below the normal thresholds.

finishInsertTable(nameMapping);
// Classification can perform metastore reads, so close that interval before any file or HMS mutation.
validateWriteMetadataBeforePublication();
try {

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.

[P1] Extend self-cleanup to lock acquisition failures. The rollback boundary still starts too late: PluginDrivenTransactionManager.commit() has already removed the transaction, so if acquireExclusiveTableLock times out or its RPC fails, this catch is never entered, the wrapper closes the connector, and the executor's later manager rollback finds no entry. Any valid S3 MPUs already fed into this transaction are then left open even though no Hive metadata was published. Please include lock acquisition in the connector's self-cleanup failure boundary (while releasing a lock only if it was acquired), and add a failure-injection test that verifies reported uploads are aborted on an HMS lock timeout/RPC failure.

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.

Rechecked on current head 64eba05b2d: this P1 is still reachable. PluginDrivenTransactionManager.commit() removes the transaction before delegating, while HiveConnectorTransaction.commit() still acquires the HMS lock before entering the self-rollback boundary in commitWhileTableLocked(). Therefore an acquireExclusiveTableLock() timeout/RPC failure closes and deregisters the connector without aborting the valid deferred S3/Azure uploads already accepted from BE; the executor cannot recover them with a later manager rollback, and no Hive metadata is published. Please move lock acquisition under an outer failure boundary that invokes connector rollback when publication has not begun, and add a failure-injection test asserting all reported uploads are aborted when lock acquisition fails.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17737	3906	3991	3906
q2	1990	325	202	202
q3	10779	1356	806	806
q4	4734	478	340	340
q5	8094	838	552	552
q6	328	166	133	133
q7	821	809	600	600
q8	10591	1537	1600	1537
q9	5646	4054	4062	4054
q10	6854	1655	1373	1373
q11	507	343	323	323
q12	743	575	448	448
q13	18111	3251	2733	2733
q14	260	255	243	243
q15	q16	738	739	664	664
q17	1007	935	1006	935
q18	6610	5616	5577	5577
q19	1315	1175	1060	1060
q20	799	692	608	608
q21	5622	2579	2327	2327
q22	434	362	299	299
Total cold run time: 103720 ms
Total hot run time: 28720 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4314	4176	4175	4175
q2	273	334	207	207
q3	4553	4882	4377	4377
q4	2171	2288	1399	1399
q5	4242	4112	4141	4112
q6	230	171	124	124
q7	1735	1606	1820	1606
q8	2459	2075	2102	2075
q9	7173	7189	7099	7099
q10	4295	4277	3864	3864
q11	545	393	386	386
q12	702	720	491	491
q13	3241	3528	2877	2877
q14	287	312	275	275
q15	q16	680	724	652	652
q17	1349	1299	1285	1285
q18	12210	11075	11772	11075
q19	1200	1168	1113	1113
q20	2235	2207	1925	1925
q21	5578	4874	4622	4622
q22	518	451	396	396
Total cold run time: 59990 ms
Total hot run time: 54135 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 157981 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 71abd40668dd002228bec77de06493982756e6aa, data reload: false

query5	4307	601	462	462
query6	461	221	194	194
query7	4876	565	326	326
query8	317	158	149	149
query9	8764	4015	3980	3980
query10	503	355	293	293
query11	5833	2203	2046	2046
query12	155	100	99	99
query13	1286	609	420	420
query14	6107	4238	3976	3976
query14_1	3793	3779	3760	3760
query15	203	197	180	180
query16	996	497	487	487
query17	926	701	560	560
query18	2445	492	339	339
query19	212	190	156	156
query20	104	104	105	104
query21	232	163	135	135
query22	13076	12972	12875	12875
query23	15761	15080	14527	14527
query23_1	14686	14681	14778	14681
query24	7551	1678	1240	1240
query24_1	1256	1235	1243	1235
query25	593	429	361	361
query26	1326	351	208	208
query27	2691	578	356	356
query28	4567	2025	1991	1991
query29	1053	605	467	467
query30	340	265	215	215
query31	1167	1125	1025	1025
query32	113	63	57	57
query33	523	329	230	230
query34	1193	1132	650	650
query35	722	753	650	650
query36	770	791	709	709
query37	151	108	94	94
query38	1826	1770	1704	1704
query39	817	810	807	807
query39_1	793	773	778	773
query40	250	160	139	139
query41	66	66	63	63
query42	95	92	93	92
query43	312	342	276	276
query44	1392	769	765	765
query45	185	178	167	167
query46	1044	1196	720	720
query47	1573	1570	1492	1492
query48	410	398	289	289
query49	590	404	288	288
query50	1142	415	352	352
query51	10809	10647	10320	10320
query52	85	90	78	78
query53	254	273	198	198
query54	274	228	211	211
query55	76	71	72	71
query56	322	289	303	289
query57	1017	1009	963	963
query58	291	255	252	252
query59	1532	1584	1367	1367
query60	305	270	249	249
query61	144	150	154	150
query62	393	317	262	262
query63	230	193	202	193
query64	2862	1023	818	818
query65	3862	3825	3829	3825
query66	1846	518	346	346
query67	20195	19957	19955	19955
query68	3343	1609	960	960
query69	406	297	262	262
query70	892	784	777	777
query71	367	333	309	309
query72	3119	2813	2547	2547
query73	829	793	436	436
query74	4633	4473	4272	4272
query75	2353	2340	1992	1992
query76	2293	1128	739	739
query77	336	362	276	276
query78	11216	11053	10595	10595
query79	1671	1200	742	742
query80	1248	545	466	466
query81	549	324	285	285
query82	647	169	133	133
query83	396	327	300	300
query84	318	166	133	133
query85	990	618	538	538
query86	408	230	245	230
query87	2000	1978	1835	1835
query88	3688	2764	2747	2747
query89	380	316	278	278
query90	1892	192	185	185
query91	201	191	162	162
query92	64	59	54	54
query93	1755	1630	1024	1024
query94	723	354	282	282
query95	791	589	467	467
query96	1120	829	358	358
query97	2474	2464	2360	2360
query98	200	187	184	184
query99	780	750	628	628
Total cold run time: 246260 ms
Total hot run time: 157981 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.14	0.08	0.09
query3	0.36	0.23	0.24
query4	1.60	0.24	0.23
query5	0.32	0.31	0.31
query6	1.15	0.66	0.65
query7	0.04	0.01	0.00
query8	0.10	0.08	0.07
query9	0.49	0.38	0.37
query10	0.57	0.57	0.57
query11	0.31	0.18	0.18
query12	0.31	0.19	0.19
query13	0.52	0.54	0.53
query14	0.92	0.91	0.91
query15	0.68	0.58	0.59
query16	0.38	0.38	0.38
query17	0.99	0.99	1.00
query18	0.29	0.27	0.28
query19	1.87	1.81	1.80
query20	0.02	0.02	0.01
query21	15.39	0.38	0.31
query22	4.86	0.15	0.14
query23	15.78	0.49	0.30
query24	2.41	0.61	0.45
query25	0.15	0.10	0.11
query26	0.75	0.28	0.22
query27	0.10	0.11	0.11
query28	3.47	0.85	0.40
query29	12.49	4.15	3.24
query30	0.38	0.26	0.26
query31	2.76	0.60	0.33
query32	3.22	0.64	0.48
query33	2.90	2.93	2.93
query34	15.56	3.94	3.27
query35	3.19	3.15	3.14
query36	0.64	0.52	0.50
query37	0.13	0.10	0.09
query38	0.08	0.07	0.06
query39	0.08	0.06	0.05
query40	0.20	0.17	0.17
query41	0.12	0.08	0.07
query42	0.09	0.06	0.05
query43	0.07	0.06	0.06
Total cold run time: 95.89 s
Total hot run time: 25.09 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 29.05% (52/179) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 27.93% (50/179) 🎉
Increment coverage report
Complete coverage report

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Review step was failure (possibly timeout or cancelled)
Workflow run: https://github.com/apache/doris/actions/runs/31500034547

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 29.05% (52/179) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 27.93% (50/179) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17680	4044	4094	4044
q2	2011	351	204	204
q3	10304	1441	837	837
q4	4677	469	350	350
q5	7495	840	558	558
q6	189	174	138	138
q7	746	777	589	589
q8	9344	1473	1449	1449
q9	5363	4093	4055	4055
q10	6711	1633	1348	1348
q11	515	364	324	324
q12	731	584	461	461
q13	18128	3505	2771	2771
q14	260	276	238	238
q15	q16	748	737	661	661
q17	937	1056	1010	1010
q18	6555	5667	5562	5562
q19	1182	1258	1104	1104
q20	834	688	590	590
q21	6095	2853	2659	2659
q22	467	425	318	318
Total cold run time: 100972 ms
Total hot run time: 29270 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5020	4757	4756	4756
q2	290	322	215	215
q3	5074	5331	4623	4623
q4	2225	2287	1417	1417
q5	4699	4448	4443	4443
q6	236	182	135	135
q7	1938	1725	1518	1518
q8	2418	2229	2052	2052
q9	7279	6890	6795	6795
q10	4260	4218	3787	3787
q11	525	384	346	346
q12	702	722	494	494
q13	3062	3368	2812	2812
q14	269	280	247	247
q15	q16	674	688	605	605
q17	1265	1227	1255	1227
q18	12136	11039	11850	11039
q19	1076	1086	1086	1086
q20	2216	2204	1908	1908
q21	5356	4564	4558	4558
q22	522	460	414	414
Total cold run time: 61242 ms
Total hot run time: 54477 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 158006 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 64eba05b2dd02d5906db8be815c11ab915c45bad, data reload: false

query5	4314	587	460	460
query6	449	222	212	212
query7	4914	579	338	338
query8	333	163	146	146
query9	8776	4047	4025	4025
query10	485	358	309	309
query11	5754	2190	2007	2007
query12	151	97	96	96
query13	1242	605	426	426
query14	6092	4296	3986	3986
query14_1	3801	3808	3797	3797
query15	201	193	179	179
query16	1002	418	461	418
query17	927	717	565	565
query18	2441	481	347	347
query19	219	194	151	151
query20	112	108	104	104
query21	238	159	132	132
query22	13132	13038	12780	12780
query23	15915	15055	14449	14449
query23_1	14711	14709	14697	14697
query24	7550	1705	1204	1204
query24_1	1240	1211	1250	1211
query25	554	420	345	345
query26	1342	364	250	250
query27	2578	604	381	381
query28	4547	2020	1952	1952
query29	1086	606	469	469
query30	347	267	228	228
query31	1180	1128	1068	1068
query32	107	62	58	58
query33	521	315	234	234
query34	1195	1197	655	655
query35	744	743	631	631
query36	784	792	728	728
query37	158	107	93	93
query38	1813	1761	1741	1741
query39	832	831	784	784
query39_1	792	804	794	794
query40	248	163	139	139
query41	65	65	63	63
query42	96	94	97	94
query43	322	324	283	283
query44	1433	776	746	746
query45	185	181	166	166
query46	983	1165	697	697
query47	1551	1524	1434	1434
query48	399	411	298	298
query49	591	435	298	298
query50	1056	413	325	325
query51	10245	10320	10565	10320
query52	88	95	76	76
query53	263	273	200	200
query54	288	234	231	231
query55	74	73	68	68
query56	337	308	290	290
query57	1024	1004	939	939
query58	290	261	267	261
query59	1568	1653	1414	1414
query60	321	271	246	246
query61	178	154	154	154
query62	420	325	272	272
query63	244	206	200	200
query64	2985	1174	972	972
query65	3858	3827	3816	3816
query66	1855	491	377	377
query67	20364	20233	19987	19987
query68	3593	1520	957	957
query69	410	304	280	280
query70	875	770	766	766
query71	378	338	318	318
query72	3221	2624	2283	2283
query73	822	757	414	414
query74	4657	4531	4309	4309
query75	2376	2352	2005	2005
query76	2400	1161	760	760
query77	332	368	259	259
query78	11261	11136	10577	10577
query79	1343	1176	776	776
query80	760	549	467	467
query81	491	329	280	280
query82	610	180	137	137
query83	374	323	298	298
query84	326	164	132	132
query85	946	623	519	519
query86	366	251	228	228
query87	2010	1977	1837	1837
query88	3744	2783	2797	2783
query89	385	327	285	285
query90	1892	212	189	189
query91	199	191	164	164
query92	63	61	57	57
query93	1609	1490	923	923
query94	609	340	313	313
query95	802	599	500	500
query96	1097	805	361	361
query97	2478	2457	2369	2369
query98	205	189	181	181
query99	746	735	631	631
Total cold run time: 245426 ms
Total hot run time: 158006 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.05	0.05
query3	0.26	0.12	0.13
query4	1.61	0.15	0.14
query5	0.25	0.23	0.23
query6	1.15	0.85	0.86
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.39	0.30	0.30
query10	0.58	0.56	0.56
query11	0.19	0.14	0.13
query12	0.19	0.16	0.14
query13	0.48	0.49	0.48
query14	1.01	0.99	1.00
query15	0.62	0.60	0.59
query16	0.33	0.32	0.33
query17	1.14	1.12	1.07
query18	0.22	0.20	0.20
query19	2.15	1.96	1.96
query20	0.02	0.01	0.01
query21	15.46	0.22	0.13
query22	4.70	0.06	0.05
query23	16.14	0.32	0.13
query24	2.91	0.42	0.32
query25	0.11	0.06	0.04
query26	0.73	0.22	0.16
query27	0.04	0.03	0.03
query28	3.49	0.81	0.38
query29	12.54	4.04	3.26
query30	0.28	0.16	0.15
query31	2.77	0.54	0.33
query32	3.22	0.59	0.49
query33	3.22	3.32	3.16
query34	15.57	3.94	3.31
query35	3.23	3.23	3.21
query36	0.56	0.44	0.43
query37	0.10	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.17	0.14
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.3 s
Total hot run time: 24.13 s

@liaoxin01 liaoxin01 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.

LGTM

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@hello-stephen

Copy link
Copy Markdown
Contributor

skip check_coverage

return ObjectStorageUploadResponse {
.resp = resp,
// Hive defers completion to FE, so the exact staged ID must cross that boundary.
.etag = block_id,

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.

is it behavior change?

uint8_t buf[4];
doris::encode_fixed32_le(buf, static_cast<uint32_t>(part_num));
return Aws::Utils::HashingUtils::Base64Encode({buf, sizeof(buf)});
std::string encode_azure_block_id(std::string_view upload_id, int part_num) {

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 with an UT

int part_num) {
DCHECK(opts.upload_id.has_value());
auto client = _client->GetBlockBlobClient(opts.key);
std::string block_id = azure_multipart_block_id(*opts.upload_id, part_num);

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.

add some comment on "block_id" an "part_num"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.1.x dev/4.1.x-conflict

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants