Skip to content

[fix](build) Recover interrupted Paimon header and archive installation - #68633

Merged
yiguolei merged 2 commits into
apache:masterfrom
Gabriel39:fix/paimon-header-archive-publication
Sep 30, 2026
Merged

yiguolei merged 2 commits into
apache:masterfrom
Gabriel39:fix/paimon-header-archive-publication

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related PR: #66227, #68562

An interrupted Paimon dependency installation can leave a truncated header or a header/archive pair from different builds that the next build incorrectly reuses.

Stage and validate the header before publishing either file, keep an incomplete-install marker until both publications succeed, and rebuild when that marker or an empty installed file is found. Tests inject header-copy and both rename failures for first installs and replacements, and verify successful repair on retry.

Release note

Fix reuse of incomplete Paimon dependency installations.

Check List (For Author)

  • Test
    • Unit Test: python3 thirdparty/test/paimon-build-test.py (16 tests passed)
    • Manual test: bash -n build.sh thirdparty/build-thirdparty.sh
  • Behavior changed:
    • Yes. Empty or interrupted Paimon installations trigger the existing full third-party rebuild.
  • Does this need documentation?
    • No.

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.

Reviewed PR #68633 at f534dcf. Complete static review after two rounds; no new valuable inline findings and no existing blocking inline comments.

  • Goal and tests: The new publisher stages and validates the Paimon header, marks the two-file publication incomplete before replacing the archive, and clears the marker after publishing the header. The build gate rebuilds on a missing, empty, or marked installation. The added Python cases cover first installs, replacements, injected copy/rename failures, retry, and gate repair. I did not run builds or tests under the review restrictions; the PR's claimed test results are not independent validation.
  • Scope and behavior: The change is confined to the build gate, Paimon installer, and its test script. No new configuration, transmitted FE/BE variable, function symbol, storage format, or rolling-upgrade protocol is involved. The new gate conditions each correspond to an incomplete-install state.
  • Concurrency and lifecycle: The in-repository build path runs third-party packages serially. The header staging, archive staging, EXIT cleanup, marker creation, two renames, and marker removal were traced through process-failure windows. No new lock, thread, static-initialization, or ownership lifecycle was added. This review does not establish host power-loss durability.
  • Parallel paths and correctness: Direct Paimon package retries run the same publisher. The separate BE unit-test build bypasses the build.sh gate, as it did before this PR; no in-repository code currently includes the generated Paimon header. A nonempty header already truncated by the old installer can pass this gate, but that is an unmarked pre-existing artifact with no demonstrated current consumer or newly introduced failure. These points were independently rechecked and dismissed as new inline findings.
  • Error handling, performance, and observability: Copy, strip, test, and rename failures propagate under shell errexit, while the marker preserves the recovery signal after publication starts. Failure remains visible through command status and the existing build log. A full third-party rebuild is triggered only when the new incomplete-state checks match; this is build-time work, not a runtime hot path.
  • Other checkpoints: No Doris transaction, persistent metadata, data write, memory allocation, or distributed operation is changed. There are no generated regression result files to validate. No additional user-provided focus was supplied.

All three changed files and all candidate points received a final sweep. Review status: complete, with no accepted new findings.

@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 76.61% (34877/45525)
Line Coverage 61.72% (393463/637517)
Region Coverage 58.29% (332297/570110)
Branch Coverage 59.08% (152162/257572)

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

Completed static review of PR #68633 at head 1d749953c1e37b5ce5257ec4ac6960c52cf42abc after two convergence rounds. I found no new substantiated inline defect and no existing P0/P1 inline blocker.

Goal and tests: The Paimon publisher stages and validates the header before changing installed artifacts, marks the pair incomplete before publishing the archive, and clears the marker after publishing the header. The build gate rebuilds on missing or empty artifacts or a leftover marker. Added tests cover first and replacement installs, injected copy/rename failures, retry, empty files, and installed-only images. This was a static review: I did not run builds or tests, and the author's test claim is not independent verification. The Paimon Python suite is not invoked by the current third-party CI script job, which limits automatic coverage.

Scope, paths, and compatibility: The three-file change is focused. I traced build.sh through the full third-party rebuild, build_paimon_rust, the archive publisher, and the package loop, including Linux/macOS gates and source versus installed-only compilation images. The full rebuild preserves the existing Lance/Paimon toolchain alignment. There is no new FE/BE protocol, persisted format, configuration item, or runtime function symbol. A nonempty mixed pair left by the old installer before this patch has no marker and still cannot be recognized; this is a pre-existing recovery limit.

Concurrency and lifecycle: No runtime threads or locks are added. Shell command failures propagate through set -e; temporary-file traps do not erase the recovery marker. The marker covers interruption after the first installed-file change. Concurrent direct third-party builds are not coordinated, as in the base revision. There is no cross-translation-unit static initialization or runtime resource lifecycle.

Conditions, errors, and observability: The new checks target missing/empty files, the incomplete marker, and the absence of a rebuild script. Installed-only images fail with a clear error before installed is removed. No transaction, EditLog, database data-write, or FE/BE variable path is changed. File checks are cheap; the full rebuild on detected damage follows the existing dependency strategy. No new runtime metrics are warranted. No test-result file was changed, and no end-to-end third-party rebuild was verified in this review.

There were no additional user focus points. Review complete: all changed files and candidate points were swept, and all second-round reviewers returned NO_NEW_VALUABLE_FINDINGS.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17811	4018	4100	4018
q2	2177	375	318	318
q3	10053	1464	796	796
q4	4690	485	353	353
q5	7516	825	552	552
q6	179	182	145	145
q7	772	787	593	593
q8	9289	1545	1570	1545
q9	5525	4243	4182	4182
q10	6832	1342	1016	1016
q11	439	292	249	249
q12	637	427	317	317
q13	18085	2628	2046	2046
q14	268	260	243	243
q15	q16	748	728	663	663
q17	1788	1085	997	997
q18	6531	5622	5554	5554
q19	1207	1301	1059	1059
q20	483	396	270	270
q21	5548	3565	2923	2923
q22	451	378	306	306
Total cold run time: 101029 ms
Total hot run time: 28145 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4968	4509	4721	4509
q2	744	596	542	542
q3	4838	5433	4669	4669
q4	2276	2346	1472	1472
q5	4691	4580	4548	4548
q6	250	187	138	138
q7	1942	1754	1491	1491
q8	2401	2219	2223	2219
q9	7400	6936	6865	6865
q10	3676	3582	3105	3105
q11	541	418	363	363
q12	730	710	517	517
q13	2328	2676	2033	2033
q14	274	282	254	254
q15	q16	669	693	608	608
q17	7275	6819	6713	6713
q18	11911	11031	11828	11031
q19	1103	992	1006	992
q20	2215	2200	1935	1935
q21	5117	4344	4443	4344
q22	528	476	408	408
Total cold run time: 65877 ms
Total hot run time: 58756 ms

@hello-stephen

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

query5	4315	629	469	469
query6	445	218	193	193
query7	4819	559	301	301
query8	322	200	169	169
query9	8882	3989	3955	3955
query10	466	315	255	255
query11	5818	3543	3233	3233
query12	152	90	85	85
query13	1255	605	400	400
query14	6556	4619	4260	4260
query14_1	4009	4005	3935	3935
query15	206	202	187	187
query16	1006	458	422	422
query17	922	688	571	571
query18	2425	475	330	330
query19	205	187	171	171
query20	87	83	79	79
query21	227	139	123	123
query22	13216	13000	12889	12889
query23	13921	12941	12464	12464
query23_1	12507	12387	12631	12387
query24	7346	1092	654	654
query24_1	671	697	680	680
query25	577	450	379	379
query26	974	322	168	168
query27	2650	566	330	330
query28	4533	1983	1947	1947
query29	1513	732	535	535
query30	304	229	193	193
query31	887	776	659	659
query32	153	103	104	103
query33	535	331	260	260
query34	1164	1116	636	636
query35	758	773	651	651
query36	801	815	731	731
query37	144	109	92	92
query38	1844	1776	1712	1712
query39	705	691	653	653
query39_1	657	675	643	643
query40	218	125	105	105
query41	72	71	68	68
query42	98	94	99	94
query43	360	370	312	312
query44	1431	720	713	713
query45	186	181	167	167
query46	1070	1189	742	742
query47	1501	1501	1413	1413
query48	403	430	301	301
query49	586	395	289	289
query50	946	357	268	268
query51	10470	10509	10169	10169
query52	86	84	80	80
query53	244	260	189	189
query54	242	219	184	184
query55	81	75	77	75
query56	248	207	224	207
query57	1451	1534	1348	1348
query58	282	270	258	258
query59	2045	2127	1895	1895
query60	295	250	223	223
query61	151	150	143	143
query62	402	322	272	272
query63	217	177	177	177
query64	2249	994	816	816
query65	3502	3418	3455	3418
query66	1790	417	311	311
query67	20162	19987	19902	19902
query68	3212	1515	922	922
query69	398	311	267	267
query70	906	835	829	829
query71	298	239	226	226
query72	2684	2481	2244	2244
query73	795	767	433	433
query74	4669	4542	4306	4306
query75	2320	2311	1962	1962
query76	2358	1153	740	740
query77	368	409	304	304
query78	9153	9043	8461	8461
query79	1359	1231	703	703
query80	586	456	368	368
query81	545	333	287	287
query82	679	169	129	129
query83	328	230	202	202
query84	345	143	120	120
query85	852	469	383	383
query86	338	239	237	237
query87	1980	2008	1839	1839
query88	3709	2719	2711	2711
query89	366	295	262	262
query90	1927	178	182	178
query91	168	169	130	130
query92	104	92	88	88
query93	1449	1373	859	859
query94	533	349	299	299
query95	660	381	337	337
query96	1077	824	312	312
query97	2407	2406	2297	2297
query98	159	152	148	148
query99	733	728	627	627
Total cold run time: 235804 ms
Total hot run time: 152537 ms

@hello-stephen

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

query1	0.00	0.00	0.01
query2	0.09	0.05	0.05
query3	0.26	0.14	0.13
query4	1.61	0.14	0.14
query5	0.24	0.22	0.22
query6	1.16	0.97	0.95
query7	0.04	0.00	0.00
query8	0.06	0.04	0.04
query9	0.39	0.35	0.36
query10	0.58	0.54	0.60
query11	0.20	0.14	0.15
query12	0.19	0.15	0.15
query13	0.48	0.47	0.46
query14	0.96	0.96	0.96
query15	0.61	0.61	0.58
query16	0.30	0.31	0.33
query17	1.09	1.06	1.11
query18	0.22	0.19	0.19
query19	1.97	1.91	1.98
query20	0.02	0.02	0.02
query21	15.48	0.20	0.14
query22	4.99	0.06	0.06
query23	16.14	0.31	0.12
query24	2.93	0.45	0.34
query25	0.10	0.05	0.05
query26	0.72	0.20	0.14
query27	0.04	0.04	0.04
query28	3.59	0.83	0.35
query29	12.59	4.06	3.22
query30	0.28	0.16	0.15
query31	2.76	0.56	0.33
query32	3.22	0.60	0.50
query33	3.18	3.18	3.17
query34	15.71	3.93	3.27
query35	3.23	3.22	3.21
query36	0.55	0.44	0.42
query37	0.09	0.07	0.06
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.16	0.14	0.14
query41	0.09	0.03	0.03
query42	0.04	0.03	0.04
query43	0.05	0.03	0.04
Total cold run time: 96.51 s
Total hot run time: 24.07 s

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17626	3929	3893	3893
q2	2198	371	320	320
q3	10057	1360	789	789
q4	4686	478	350	350
q5	7518	837	562	562
q6	178	164	134	134
q7	732	785	599	599
q8	9347	1823	1549	1549
q9	5377	4192	4168	4168
q10	6835	1313	1020	1020
q11	427	266	240	240
q12	638	407	298	298
q13	18045	2607	1995	1995
q14	267	256	232	232
q15	q16	731	723	657	657
q17	1873	1099	1064	1064
q18	6413	5619	5530	5530
q19	1340	1313	980	980
q20	473	381	258	258
q21	5745	3305	2824	2824
q22	462	370	319	319
Total cold run time: 100968 ms
Total hot run time: 27781 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4678	4728	4530	4530
q2	712	586	537	537
q3	4729	5156	4649	4649
q4	2172	2331	1458	1458
q5	4596	4357	4602	4357
q6	228	165	122	122
q7	1801	1777	1494	1494
q8	2420	2054	2005	2005
q9	7358	7282	7202	7202
q10	3661	3607	3075	3075
q11	522	368	338	338
q12	694	692	493	493
q13	2270	2614	1996	1996
q14	270	278	253	253
q15	q16	661	681	605	605
q17	7262	6693	6636	6636
q18	11768	11025	11796	11025
q19	1078	1003	1002	1002
q20	2206	2186	1930	1930
q21	5176	4054	4279	4054
q22	520	445	424	424
Total cold run time: 64782 ms
Total hot run time: 58185 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 152401 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 1d749953c1e37b5ce5257ec4ac6960c52cf42abc, data reload: false

query5	4338	596	470	470
query6	432	218	199	199
query7	4834	558	302	302
query8	317	176	161	161
query9	8787	3943	3920	3920
query10	457	300	258	258
query11	5828	3553	3228	3228
query12	151	92	88	88
query13	1262	568	429	429
query14	6524	4518	4252	4252
query14_1	3934	3978	3945	3945
query15	203	209	180	180
query16	992	457	425	425
query17	909	690	551	551
query18	2438	466	337	337
query19	206	186	142	142
query20	86	81	83	81
query21	223	136	116	116
query22	13057	12967	12877	12877
query23	13962	13046	12323	12323
query23_1	12567	12561	12561	12561
query24	7414	1119	666	666
query24_1	652	718	772	718
query25	557	439	379	379
query26	1259	306	166	166
query27	2743	546	337	337
query28	4580	1937	1916	1916
query29	1675	736	543	543
query30	303	226	182	182
query31	888	757	654	654
query32	175	101	98	98
query33	537	318	257	257
query34	1148	1099	626	626
query35	722	776	643	643
query36	811	817	733	733
query37	153	105	98	98
query38	1837	1775	1715	1715
query39	695	700	662	662
query39_1	657	644	695	644
query40	224	123	99	99
query41	73	69	67	67
query42	96	95	96	95
query43	330	355	293	293
query44	1346	711	713	711
query45	227	185	157	157
query46	1057	1137	733	733
query47	1495	1505	1449	1449
query48	361	409	282	282
query49	588	398	298	298
query50	926	337	255	255
query51	10471	10696	10201	10201
query52	90	88	75	75
query53	234	259	179	179
query54	234	194	188	188
query55	77	73	68	68
query56	240	223	195	195
query57	1491	1395	1288	1288
query58	284	254	260	254
query59	1964	2077	1868	1868
query60	271	238	231	231
query61	155	149	146	146
query62	390	320	267	267
query63	218	169	173	169
query64	2873	1007	817	817
query65	3477	3396	3397	3396
query66	1793	416	306	306
query67	20201	20286	20000	20000
query68	3239	1537	868	868
query69	386	288	258	258
query70	917	822	804	804
query71	290	235	198	198
query72	2570	2519	2219	2219
query73	792	787	434	434
query74	4605	4475	4295	4295
query75	2276	2283	1924	1924
query76	2316	1121	755	755
query77	351	392	297	297
query78	9077	9094	8555	8555
query79	1339	1199	751	751
query80	779	467	374	374
query81	557	315	277	277
query82	831	164	130	130
query83	292	232	200	200
query84	313	143	115	115
query85	987	461	387	387
query86	355	222	232	222
query87	2010	1973	1847	1847
query88	3591	2712	2701	2701
query89	381	286	247	247
query90	1734	178	176	176
query91	168	158	131	131
query92	105	86	86	86
query93	1506	1419	858	858
query94	602	347	292	292
query95	670	449	331	331
query96	1072	773	343	343
query97	2484	2412	2316	2316
query98	165	171	147	147
query99	720	743	628	628
Total cold run time: 236678 ms
Total hot run time: 152401 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.10	0.04	0.04
query3	0.27	0.14	0.13
query4	1.60	0.14	0.14
query5	0.24	0.22	0.23
query6	1.16	0.95	0.95
query7	0.04	0.01	0.01
query8	0.05	0.04	0.04
query9	0.40	0.34	0.34
query10	0.53	0.54	0.56
query11	0.21	0.14	0.14
query12	0.18	0.15	0.14
query13	0.46	0.45	0.47
query14	0.95	0.95	0.94
query15	0.60	0.59	0.60
query16	0.32	0.32	0.32
query17	1.08	1.08	1.05
query18	0.23	0.21	0.21
query19	1.98	1.94	1.89
query20	0.02	0.02	0.02
query21	15.50	0.24	0.13
query22	4.81	0.06	0.05
query23	16.15	0.30	0.12
query24	2.96	0.43	0.32
query25	0.11	0.05	0.04
query26	0.72	0.22	0.15
query27	0.05	0.03	0.03
query28	3.52	0.75	0.36
query29	12.51	4.09	3.21
query30	0.28	0.16	0.15
query31	2.76	0.56	0.31
query32	3.24	0.58	0.48
query33	3.24	3.19	3.18
query34	15.75	3.94	3.27
query35	3.23	3.24	3.25
query36	0.55	0.44	0.45
query37	0.09	0.07	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.02
query42	0.04	0.03	0.04
query43	0.04	0.03	0.03
Total cold run time: 96.31 s
Total hot run time: 23.99 s

@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 76.58% (34918/45599)
Line Coverage 61.72% (394033/638471)
Region Coverage 58.02% (331277/570957)
Branch Coverage 59.00% (152283/258104)

@yiguolei
yiguolei merged commit 36f1e09 into apache:master Sep 30, 2026
37 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Sep 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants