Skip to content

[fix](be) Catch ORC exceptions during RowID seeks - #69465

Merged
Gabriel39 merged 4 commits into
apache:masterfrom
suxiaogang223:codex/fix-orc-rowid-seek-exception
Oct 27, 2026
Merged

Gabriel39 merged 4 commits into
apache:masterfrom
suxiaogang223:codex/fix-orc-rowid-seek-exception

Conversation

@suxiaogang223

@suxiaogang223 suxiaogang223 commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: N/A

Related PR: #67141

The legacy ORC reader performs RowID seekToRow before the exception handlers around nextBatch. A seek can throw orc::ParseError while reading a missing or unreadable file, and that std::exception can escape the external row-fetch worker and terminate the BE.

Catch seek exceptions before lazy or non-lazy reads and return an error with the file and cause. Preserve Doris exception propagation and error classification. Keep clean EOF only for a stopped reader throwing "stop"; report unrelated I/O errors even when cancellation races with them. Return zero rows when no requested RowIDs remain.

The injected-error regression lives in its own p0,external,hive,nonConcurrent suite with a separate catalog and the preloaded Hive fixture. It pins the legacy-reader and TopN settings, asserts phase-two materialization, checks the expected seek failure, and verifies a successful five-row query after removing the debug point. Debug-point cleanup and session restoration run in finally blocks. The original TopN suite retains its concurrent correctness coverage.

The branch has been rebased onto master 6e5a8929fba, including the unrelated BE UT compile fix #69487.

Release note

Fix BE termination when an ORC RowID seek fails during external TopN late materialization.

Check List (For Author)

  • Test:
    • Added real-ORC seek unit cases for lazy/non-lazy errors, cancellation, Doris exception propagation, empty RowIDs and normal seek progression. Runtime verification remains for CI.
    • Groovy 4.0.19 CONVERSION-phase compilation passed for both regression suites.
    • Local mock execution passed serial-group validation, independent catalog setup, recovery-query execution, and debug-point/session cleanup after success, unexpected query failure and partial enable failure.
    • git diff --check passed.
    • ./run-regression-test.sh --compile remains blocked by pre-existing duplicate Gson declarations rejected by the local Maven installation. Mocks do not replace live cluster regression.
    • BE UT and External Regression reruns requested for the updated head. The external runner enables -runNonConcurrent true.
  • Behavior changed: Yes. Seek exceptions return errors; cancelled stop reads retain EOF behavior.
  • Does this need documentation: No.

Self-review

  • Goal and scope: repair the seek exception boundary and move only its global injection into an independently runnable serial suite.
  • Parallel paths: lazy and non-lazy seeks share the exception boundary; Doris errors retain their worker-side handling.
  • Concurrency and lifecycle: the all-BE injection is serial, scoped to one debug point, and removed before recovery. Session settings are restored on every exit.
  • Coverage and observability: the plan assertion ensures phase-two materialization; expected error matching and recovery remain enforced. The returned error includes the file and underlying cause.
  • Compatibility: no new configuration, FE/BE protocol, persistence, transaction or storage-format changes.

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

@suxiaogang223

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17577	5111	5075	5075
q2	2133	300	245	245
q3	10273	1370	808	808
q4	4682	462	332	332
q5	7664	795	528	528
q6	183	183	156	156
q7	748	801	614	614
q8	9297	1363	1027	1027
q9	5520	4270	4223	4223
q10	6832	1293	1033	1033
q11	431	246	230	230
q12	644	398	277	277
q13	18083	3569	3002	3002
q14	281	268	253	253
q15	q16	717	707	662	662
q17	1179	742	559	559
q18	6952	6157	6120	6120
q19	1089	944	611	611
q20	389	332	221	221
q21	4683	2112	2245	2112
q22	342	290	251	251
Total cold run time: 99699 ms
Total hot run time: 28339 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5607	5595	5611	5595
q2	679	569	553	553
q3	5185	5352	4944	4944
q4	1982	2128	1557	1557
q5	5286	5195	5528	5195
q6	276	208	149	149
q7	2336	2080	1840	1840
q8	3008	2723	2703	2703
q9	7908	7990	7970	7970
q10	3727	3652	3219	3219
q11	613	436	569	436
q12	697	695	507	507
q13	3445	3897	3180	3180
q14	327	304	308	304
q15	q16	744	736	635	635
q17	8223	7616	6877	6877
q18	13033	12172	12895	12172
q19	915	764	780	764
q20	2135	2167	1923	1923
q21	5606	5141	4667	4667
q22	488	461	411	411
Total cold run time: 72220 ms
Total hot run time: 65601 ms

@hello-stephen

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

query5	4301	575	452	452
query6	428	205	185	185
query7	4809	437	221	221
query8	315	169	151	151
query9	8743	3021	3060	3021
query10	467	307	259	259
query11	5971	3854	3596	3596
query12	161	122	100	100
query13	1251	443	337	337
query14	6134	3890	3627	3627
query14_1	3395	3405	3373	3373
query15	222	202	191	191
query16	921	430	406	406
query17	839	636	511	511
query18	2402	414	308	308
query19	187	166	130	130
query20	88	82	81	81
query21	205	123	109	109
query22	12914	12951	12826	12826
query23	13411	12799	12360	12360
query23_1	12596	12555	12438	12438
query24	7380	818	476	476
query24_1	468	455	470	455
query25	551	446	366	366
query26	1258	294	137	137
query27	2735	432	264	264
query28	4621	1926	1900	1900
query29	1557	584	433	433
query30	302	213	185	185
query31	1010	925	793	793
query32	144	90	89	89
query33	512	301	233	233
query34	875	835	500	500
query35	724	765	636	636
query36	819	797	722	722
query37	121	95	80	80
query38	1789	1696	1661	1661
query39	780	809	747	747
query39_1	735	717	736	717
query40	211	112	96	96
query41	68	65	61	61
query42	85	83	82	82
query43	339	355	311	311
query44	1360	692	674	674
query45	175	175	158	158
query46	832	973	580	580
query47	2862	2950	2756	2756
query48	294	302	221	221
query49	566	393	285	285
query50	700	270	214	214
query51	10617	10508	10570	10508
query52	89	79	69	69
query53	187	209	159	159
query54	258	186	195	186
query55	71	71	67	67
query56	254	243	215	215
query57	1652	1614	1561	1561
query58	289	271	278	271
query59	2110	2110	1955	1955
query60	294	258	237	237
query61	170	169	163	163
query62	402	333	286	286
query63	192	158	172	158
query64	2883	1030	868	868
query65	3853	3294	3290	3290
query66	1801	444	329	329
query67	20142	20157	20081	20081
query68	2974	1039	603	603
query69	380	301	256	256
query70	846	766	773	766
query71	316	239	213	213
query72	2800	2568	2243	2243
query73	519	550	297	297
query74	4634	4496	4338	4338
query75	2331	2293	1882	1882
query76	2306	1010	609	609
query77	336	363	262	262
query78	9777	9690	9152	9152
query79	994	848	518	518
query80	1246	434	354	354
query81	597	316	265	265
query82	583	176	107	107
query83	297	192	179	179
query84	310	127	98	98
query85	836	426	372	372
query86	400	239	230	230
query87	2008	1982	1821	1821
query88	3735	2665	2657	2657
query89	331	280	240	240
query90	1876	175	164	164
query91	157	147	124	124
query92	97	83	91	83
query93	1097	1025	572	572
query94	643	291	273	273
query95	580	328	352	328
query96	667	506	235	235
query97	2440	2465	2335	2335
query98	162	157	147	147
query99	763	755	652	652
Total cold run time: 235621 ms
Total hot run time: 150717 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.05	0.04
query3	0.26	0.09	0.09
query4	1.61	0.09	0.10
query5	0.23	0.23	0.24
query6	1.16	0.68	0.68
query7	0.04	0.01	0.00
query8	0.06	0.04	0.04
query9	0.41	0.36	0.36
query10	0.62	0.57	0.60
query11	0.20	0.15	0.15
query12	0.18	0.15	0.15
query13	0.48	0.48	0.49
query14	1.03	1.00	1.02
query15	0.62	0.60	0.61
query16	0.35	0.35	0.36
query17	1.14	1.14	1.15
query18	0.20	0.20	0.19
query19	2.10	1.96	1.93
query20	0.02	0.02	0.01
query21	15.50	0.18	0.13
query22	4.91	0.05	0.05
query23	16.27	0.33	0.13
query24	3.06	0.50	0.43
query25	0.11	0.06	0.04
query26	1.02	0.21	0.16
query27	0.04	0.03	0.03
query28	3.67	0.77	0.35
query29	12.50	4.11	3.22
query30	0.29	0.13	0.11
query31	2.77	0.54	0.32
query32	3.21	0.59	0.50
query33	3.13	3.27	3.15
query34	15.33	4.00	3.41
query35	3.34	3.32	3.32
query36	0.55	0.49	0.45
query37	0.09	0.06	0.06
query38	0.06	0.04	0.03
query39	0.04	0.03	0.03
query40	0.17	0.14	0.14
query41	0.10	0.03	0.03
query42	0.04	0.02	0.03
query43	0.05	0.03	0.03
Total cold run time: 97.06 s
Total hot run time: 24.24 s

### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#67141

Problem Summary: The legacy ORC reader performs RowID seekToRow before the exception handlers around nextBatch. A seek can read a missing or unreadable file and throw orc::ParseError, which escapes the external row-fetch worker because its Doris exception boundary does not catch std::exception. Catch seek exceptions before dispatching either lazy or non-lazy reads and return an error with the file and cause. Keep the existing clean-EOF convention only for a stopped reader throwing "stop"; report other I/O failures even if cancellation races with them. Set the row count to zero when no requested RowIDs remain.

### Release note

Fix BE termination when an ORC RowID seek fails during external TopN late materialization.

### Check List (For Author)

- Test: Add real-ORC seek unit cases and an injected-error Hive TopN regression. Build hygiene, clang-format 16, diff checking and Groovy syntax compilation passed. BE build is blocked by the missing LLVM 20 third-party toolchain; UT download was stopped before execution; regression framework rejects existing duplicate Gson declarations. clang-tidy lacks a compilation database. Runtime verification remains for CI.
- Behavior changed: Yes. Seek exceptions return errors; cancelled stop reads retain EOF behavior.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary: Doris exceptions also derive from std::exception. Preserve their existing worker-side error-code handling, including memory-limit classification, instead of converting them into generic ORC I/O errors. Add lazy/non-lazy real-seek unit cases for Doris exception propagation and keep the test stream fault behavior reusable.

### Release note

None

### Check List (For Author)

- Test: Build-hygiene gates and clang-format 16 passed. Added two parameterized Doris exception cases; runtime BE/UT and sanitizer validation remain blocked by the local third-party toolchain/download environment. The SQL regression is syntax-compiled but its runner is blocked by existing duplicate Gson dependencies.
- Behavior changed: No additional user-visible behavior beyond the ORC seek fix; existing Doris error classification is preserved.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#69465

Problem Summary: The TopN Hive suite runs concurrently, so the framework rejects its new all-BE debug point before the ORC seek is exercised. Move the injection into a separate nonConcurrent suite with its own catalog and explicit legacy-reader/cache/TopN settings. Keep the plan assertion and expected seek error, verify a successful five-row query after cleanup, and restore session settings on every exit. The original TopN suite retains its existing parallel correctness coverage.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - Groovy 4.0.19 CONVERSION-phase compilation passed for both suites.
    - Local mock execution passed serial-group validation, independent catalog setup, recovery query, and debug-point/session cleanup on success, unexpected query error and partial debug-point enable failure.
    - git diff --check passed.
    - ./run-regression-test.sh --compile remains blocked by pre-existing duplicate Gson declarations rejected by the local Maven installation. Full external execution and BE UT are delegated to the requested CI reruns.
- Behavior changed: No production behavior changes.
- Does this need documentation: No
@suxiaogang223
suxiaogang223 force-pushed the codex/fix-orc-rowid-seek-exception branch from f29710b to 5b85b28 Compare October 23, 2026 07:02
@suxiaogang223

Copy link
Copy Markdown
Member Author

run beut

@suxiaogang223

Copy link
Copy Markdown
Member Author

run external

@suxiaogang223

Copy link
Copy Markdown
Member Author

run buildall

@suxiaogang223

Copy link
Copy Markdown
Member 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 exact head 5b85b28. No new actionable defects found, and there are no existing inline findings to carry forward.

Critical checkpoint conclusions:

  • Goal: the shared seek boundary converts standard ORC seek exceptions into query errors before either legacy read branch, while rethrowing Doris exceptions to preserve worker error classification.
  • Scope: the four-file change is focused; moving the private helper into the source file keeps debug-point dependencies out of the header.
  • Concurrency: per-task reader ownership and existing status-before-completion publication are preserved; no new locks or thread interactions. The global fault regression uses the serial suite group.
  • Lifecycle: scanner/profile/stream/IOContext lifetimes and unit-fixture destruction order are consistent; no new ownership cycles or static initialization dependency.
  • Configuration: no new settings; the regression restores the three session values it changes.
  • Compatibility: no public interface, class layout, storage format, or new libc API change.
  • Thrift/protobuf: unchanged; field-ID compatibility checks are not applicable.
  • Parallel paths: both legacy lazy modes share this boundary. Condition-cache seeks and V2 RowID seeks already have exception boundaries.
  • Conditions: clean EOF requires cancellation plus the exact stop token; unrelated I/O failures remain errors, failed seeks retain their RowID, and exhausted IDs return zero rows.
  • Test coverage: eight unit cases parameterized across both lazy flags cover errors, cancellation classification, Doris codes, empty IDs, and seek progression. The independent Hive regression checks materialization, injected worker failure, fault cleanup, and a five-row recovery query.
  • Test results: no output baselines changed. Fixture provisioning, expected error text, row-count assertions, and test DSL were inspected.
  • Observability: the new error carries the file path and original cause through existing Status propagation.
  • Transactions/persistence: unchanged; visibility, delete-bitmap, EditLog, and failover protocols are outside this read-side fix.
  • Data writes/atomicity: no production write path changes.
  • FE/BE variables: none added or changed.
  • Memory/performance: no new significant retained allocation, successful-read copying, or asymptotic cost; existing task memory context remains attached.
  • Other concerns: no additional user focus was supplied, and no unresolved code candidate remains after the complete runtime, test, and focused-risk reviews.

Limits: static review only; no builds, unit/regression tests, or completed ELF compatibility audits were run. The new unit cases stop before successful nextBatch decoding, cancellation uses an initially empty block, and recovery is checked with a fresh query rather than reuse of a failed reader. The shared boundary placement, clearing branch, existing initialized reader tests, and regression provide complementary static coverage; runtime validation remains for CI.

Review converged after 2 round(s).

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17595	5200	5055	5055
q2	2102	337	247	247
q3	10222	1390	818	818
q4	4683	464	336	336
q5	7437	787	530	530
q6	180	189	155	155
q7	757	802	593	593
q8	9270	1367	1050	1050
q9	5512	4231	4206	4206
q10	6820	1298	1035	1035
q11	430	243	227	227
q12	639	396	278	278
q13	18123	3596	3053	3053
q14	272	274	248	248
q15	q16	717	709	672	672
q17	1227	746	600	600
q18	6999	6236	6147	6147
q19	1107	952	614	614
q20	396	338	226	226
q21	5040	2124	2299	2124
q22	355	300	254	254
Total cold run time: 99883 ms
Total hot run time: 28468 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5606	5585	5583	5583
q2	682	579	522	522
q3	5209	5396	4977	4977
q4	2013	2118	1539	1539
q5	5279	5154	5558	5154
q6	262	205	155	155
q7	2343	2107	1874	1874
q8	3125	2911	2752	2752
q9	8169	8139	7962	7962
q10	3724	3651	3230	3230
q11	614	431	396	396
q12	706	700	517	517
q13	3449	3984	3271	3271
q14	308	305	292	292
q15	q16	735	725	652	652
q17	8269	7530	7296	7296
q18	12995	12266	12976	12266
q19	891	789	772	772
q20	2165	2171	1912	1912
q21	5584	4625	4683	4625
q22	523	439	408	408
Total cold run time: 72651 ms
Total hot run time: 66155 ms

@hello-stephen

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

query5	4304	588	444	444
query6	420	202	186	186
query7	4812	441	227	227
query8	320	168	156	156
query9	8761	3095	3094	3094
query10	491	299	264	264
query11	6067	3845	3551	3551
query12	146	89	85	85
query13	1245	430	327	327
query14	6101	3956	3659	3659
query14_1	3424	3420	3411	3411
query15	218	202	182	182
query16	958	429	407	407
query17	855	670	540	540
query18	2409	426	306	306
query19	198	165	151	151
query20	83	82	85	82
query21	211	133	108	108
query22	13058	13055	12816	12816
query23	13567	12838	12488	12488
query23_1	12705	12495	12578	12495
query24	7375	814	453	453
query24_1	472	473	474	473
query25	543	420	364	364
query26	1262	259	140	140
query27	2778	439	271	271
query28	4629	1922	1922	1922
query29	1581	599	446	446
query30	295	225	191	191
query31	1002	931	818	818
query32	143	94	100	94
query33	547	313	252	252
query34	918	837	487	487
query35	764	765	651	651
query36	836	776	714	714
query37	128	103	84	84
query38	1781	1731	1657	1657
query39	793	802	739	739
query39_1	735	725	758	725
query40	224	118	96	96
query41	75	71	67	67
query42	86	85	84	84
query43	340	364	317	317
query44	1341	690	681	681
query45	178	181	167	167
query46	841	951	561	561
query47	2723	3016	2791	2791
query48	286	306	213	213
query49	565	389	286	286
query50	682	257	201	201
query51	10479	10394	10487	10394
query52	78	80	69	69
query53	185	207	147	147
query54	221	192	170	170
query55	71	73	61	61
query56	238	216	208	208
query57	1674	1608	1561	1561
query58	276	257	260	257
query59	2122	2114	1976	1976
query60	274	246	223	223
query61	146	141	144	141
query62	394	325	307	307
query63	191	160	161	160
query64	2743	987	757	757
query65	3316	3268	3268	3268
query66	1771	431	321	321
query67	20291	20324	19953	19953
query68	2990	1047	599	599
query69	379	276	249	249
query70	840	777	761	761
query71	289	235	206	206
query72	2706	2578	2320	2320
query73	506	527	288	288
query74	4651	4551	4340	4340
query75	2357	2271	1908	1908
query76	2323	1009	585	585
query77	348	371	256	256
query78	9859	9742	9307	9307
query79	1041	859	526	526
query80	986	425	370	370
query81	580	317	267	267
query82	578	132	109	109
query83	301	199	182	182
query84	314	126	104	104
query85	866	430	376	376
query86	348	236	229	229
query87	2001	1959	1791	1791
query88	3675	2672	2666	2666
query89	337	276	239	239
query90	1826	174	174	174
query91	158	162	131	131
query92	102	91	88	88
query93	1031	1012	578	578
query94	539	333	282	282
query95	569	397	308	308
query96	671	506	235	235
query97	2418	2428	2328	2328
query98	180	149	152	149
query99	764	760	643	643
Total cold run time: 235054 ms
Total hot run time: 150858 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.10	0.05	0.05
query3	0.27	0.09	0.09
query4	1.61	0.10	0.10
query5	0.24	0.25	0.25
query6	1.17	0.70	0.69
query7	0.04	0.02	0.00
query8	0.05	0.04	0.04
query9	0.41	0.36	0.36
query10	0.58	0.59	0.62
query11	0.21	0.15	0.14
query12	0.19	0.15	0.15
query13	0.50	0.50	0.48
query14	1.06	1.01	1.03
query15	0.63	0.61	0.62
query16	0.36	0.35	0.36
query17	1.15	1.13	1.13
query18	0.23	0.21	0.21
query19	2.11	1.96	1.92
query20	0.02	0.01	0.01
query21	15.45	0.20	0.13
query22	4.81	0.06	0.05
query23	16.26	0.32	0.12
query24	2.88	0.58	0.46
query25	0.10	0.07	0.04
query26	1.01	0.21	0.15
query27	0.05	0.03	0.04
query28	3.19	0.80	0.35
query29	12.49	4.13	3.30
query30	0.28	0.13	0.10
query31	2.77	0.55	0.33
query32	3.22	0.60	0.50
query33	3.14	3.27	3.27
query34	15.23	3.98	3.40
query35	3.35	3.36	3.34
query36	0.55	0.43	0.42
query37	0.10	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.16	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.25 s
Total hot run time: 24.53 s

### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#69465

Problem Summary: The ORC RowID seek unit tests expected a wrapped input stream to fail during seekToRow. For the fixture file, seekToRow did not read the stream, so the test entered nextBatch with an uninitialized batch and aborted. Inject the requested exception directly at the existing seek debug point and initialize the test batch as a real reader does. Keep the SQL regression default debug-point failure unchanged.

### Release note

None

### Check List (For Author)

- Test: Formatting and build hygiene checks passed; BE UT is pending CI. No local compilation or unit tests were run.
- Behavior changed: No; this changes test injection and the existing debug point callback path only.
- Does this need documentation: No
@suxiaogang223

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (34/34) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 66.90% (32192/48121)
Line Coverage 51.71% (340403/658301)
Region Coverage 47.10% (275838/585627)
Branch Coverage 48.81% (130105/266559)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17636	5149	5039	5039
q2	2153	351	249	249
q3	10186	1388	824	824
q4	4682	469	338	338
q5	7441	788	539	539
q6	181	181	152	152
q7	755	793	600	600
q8	9241	1338	1147	1147
q9	5426	4241	4206	4206
q10	6841	1282	1028	1028
q11	438	244	230	230
q12	637	401	285	285
q13	18090	3671	3012	3012
q14	267	264	250	250
q15	q16	745	717	658	658
q17	1205	748	581	581
q18	7057	6168	6113	6113
q19	1159	965	611	611
q20	385	345	219	219
q21	5667	2602	2469	2469
q22	374	333	279	279
Total cold run time: 100566 ms
Total hot run time: 28829 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5967	5887	6136	5887
q2	714	644	552	552
q3	5571	5868	5343	5343
q4	2010	2177	1568	1568
q5	5711	5853	5610	5610
q6	245	187	142	142
q7	2288	2054	1800	1800
q8	2987	2664	2591	2591
q9	7979	7535	7550	7535
q10	3639	3608	3111	3111
q11	570	404	374	374
q12	683	672	501	501
q13	3290	3580	3064	3064
q14	289	287	265	265
q15	q16	675	691	640	640
q17	7687	7000	6830	6830
q18	12936	12214	12816	12214
q19	920	789	779	779
q20	2144	2145	1931	1931
q21	5541	4572	4697	4572
q22	493	450	394	394
Total cold run time: 72339 ms
Total hot run time: 65703 ms

@hello-stephen

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

query5	4305	601	450	450
query6	419	213	206	206
query7	4805	451	238	238
query8	313	175	156	156
query9	8803	3132	3131	3131
query10	442	320	266	266
query11	6051	3856	3582	3582
query12	146	94	87	87
query13	1255	439	322	322
query14	6180	3988	3693	3693
query14_1	3462	3453	3516	3453
query15	216	202	187	187
query16	986	459	456	456
query17	979	672	553	553
query18	2443	437	313	313
query19	200	165	132	132
query20	103	87	84	84
query21	212	134	114	114
query22	13092	13047	12831	12831
query23	13570	12897	12407	12407
query23_1	12627	12568	12600	12568
query24	7346	885	486	486
query24_1	470	474	478	474
query25	533	428	368	368
query26	1265	259	145	145
query27	2769	443	273	273
query28	4584	1928	1924	1924
query29	1574	595	467	467
query30	302	224	186	186
query31	1014	926	824	824
query32	157	100	93	93
query33	536	310	245	245
query34	900	844	498	498
query35	727	749	673	673
query36	817	807	714	714
query37	125	107	89	89
query38	1775	1757	1683	1683
query39	799	788	745	745
query39_1	743	726	742	726
query40	226	121	99	99
query41	71	70	68	68
query42	90	86	83	83
query43	351	357	313	313
query44	1383	694	699	694
query45	184	175	170	170
query46	820	942	564	564
query47	2790	2729	2870	2729
query48	289	312	221	221
query49	566	402	289	289
query50	674	269	206	206
query51	10697	10505	11523	10505
query52	86	80	68	68
query53	186	215	150	150
query54	233	196	200	196
query55	73	66	64	64
query56	250	214	213	213
query57	1666	1606	1580	1580
query58	292	262	270	262
query59	2180	2186	1949	1949
query60	294	246	225	225
query61	163	184	169	169
query62	399	349	287	287
query63	193	164	166	164
query64	2763	920	820	820
query65	3334	3284	3292	3284
query66	1774	415	297	297
query67	20206	20007	20051	20007
query68	2936	1019	607	607
query69	384	329	241	241
query70	850	762	773	762
query71	296	235	209	209
query72	2775	2576	2305	2305
query73	517	525	294	294
query74	4658	4504	4341	4341
query75	2345	2323	1931	1931
query76	2321	1021	595	595
query77	362	383	273	273
query78	9798	9871	9260	9260
query79	1023	855	514	514
query80	790	440	341	341
query81	557	322	278	278
query82	919	137	107	107
query83	294	196	183	183
query84	289	134	108	108
query85	970	441	368	368
query86	351	251	206	206
query87	2030	1968	1814	1814
query88	3661	2672	2656	2656
query89	338	285	246	246
query90	1709	172	175	172
query91	156	148	128	128
query92	92	92	88	88
query93	1031	1016	585	585
query94	516	325	269	269
query95	572	398	300	300
query96	668	504	236	236
query97	2488	2444	2337	2337
query98	172	167	142	142
query99	770	765	642	642
Total cold run time: 235660 ms
Total hot run time: 151453 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.10	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.10	0.10
query5	0.23	0.25	0.24
query6	1.16	0.69	0.67
query7	0.03	0.02	0.01
query8	0.05	0.04	0.04
query9	0.41	0.35	0.35
query10	0.56	0.60	0.60
query11	0.19	0.14	0.14
query12	0.18	0.14	0.15
query13	0.50	0.51	0.49
query14	1.02	1.01	1.01
query15	0.64	0.61	0.60
query16	0.34	0.34	0.35
query17	1.16	1.14	1.15
query18	0.22	0.20	0.20
query19	2.08	2.00	2.02
query20	0.02	0.02	0.01
query21	15.48	0.19	0.14
query22	4.90	0.05	0.05
query23	16.32	0.33	0.12
query24	3.06	0.73	0.38
query25	0.10	0.07	0.06
query26	1.01	0.21	0.14
query27	0.06	0.06	0.05
query28	3.25	0.72	0.38
query29	12.52	4.16	3.26
query30	0.29	0.13	0.10
query31	2.77	0.56	0.33
query32	3.22	0.60	0.50
query33	3.36	3.17	3.25
query34	15.41	3.98	3.41
query35	3.35	3.36	3.32
query36	0.54	0.45	0.48
query37	0.09	0.07	0.06
query38	0.04	0.04	0.03
query39	0.04	0.03	0.03
query40	0.18	0.15	0.14
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.03	0.04
Total cold run time: 96.94 s
Total hot run time: 24.43 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (34/34) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.40% (36087/46626)
Line Coverage 62.64% (407937/651267)
Region Coverage 59.09% (344808/583497)
Branch Coverage 60.02% (159599/265905)

@suxiaogang223

Copy link
Copy Markdown
Member 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.

No actionable defects found in the four-file diff at 4acaeb7. Two complete-scope reviewers and a separate exception/cancellation reviewer returned NO_NEW_VALUABLE_FINDINGS. The main review independently verified their evidence. Existing inline threads are empty; no existing P0/P1 finding is carried forward. No additional user focus was provided.

Critical checkpoint conclusions:

  1. Goal and evidence: the common seek boundary converts ORC/std exceptions to a checked error with file/cause, preserves Doris exception propagation, and returns zero rows on RowID exhaustion. Added unit and SQL cases target these behaviors; they were inspected, not executed.
  2. Scope and clarity: the helper extraction, exception boundary, injection point, unit cases, and independent regression are focused on the seek failure.
  3. Concurrency and locks: the existing external fetch worker catches Doris exceptions, publishes status before completion notification, releases its semaphore, and waits for accepted tasks before releasing captured state. This change introduces no new locks or lock order. Global SQL injection runs in the nonConcurrent single-suite executor.
  4. Lifecycle and memory: scanner/profile/IOContext ownership remains valid through worker completion. Unit callbacks are removed before fixture destruction; nested finally blocks remove the SQL point and restore settings. No new persistent allocation or cross-TU initializer is introduced.
  5. Configuration: no configuration item is added. The regression scopes and restores the three existing session settings needed to select legacy materialization and avoid cached results.
  6. Compatibility: no persisted format or public protocol changes. The internal helper extraction introduces no new libc API, linker, or toolchain dependency; final ELF/glibc compatibility was not audited without built artifacts.
  7. Thrift/protobuf: no gensrc definitions or field IDs change.
  8. Parallel paths: both legacy lazy/non-lazy modes share the boundary. Existing condition-cache seeks are already guarded; V2 ORC already guards RowID seeks in its own read boundary. Parquet uses a separate row-range mechanism.
  9. Conditional behavior: only the established stop flag plus exact "stop" sentinel becomes clean EOF. Unrelated I/O failures remain errors during cancellation; seek failure leaves the requested RowID unconsumed. Comments explain the exception boundary and injection use.
  10. Test coverage: eight parameterized unit cases cover seek errors, Doris errors, cancellation before/during seek, stop without cancellation, unrelated errors during cancellation, empty IDs, and seek progression. The Hive2 fixture is independently preloaded; the regression requires VMaterializeNode, the unique injected error, and a successful five-row query afterward.
  11. Test results: no expected-output files change. SQL uses ORDER BY and test/sql/exception; recovery checks row count. Unit lazy flags cover the common pre-read boundary, rather than independently proving successful decoding in both modes.
  12. Observability: seek errors include the file and underlying cause; existing scanner/RPC layers preserve the error through query failure. Additional logs or metrics are unnecessary for this localized boundary.
  13. Transactions and persistence: no commit, replay, version visibility, or delete-bitmap behavior changes.
  14. Data writes and atomicity: production changes only reads; the regression creates its private catalog and reads existing fixtures. No new data-write/crash-atomicity path is introduced.
  15. FE/BE variables: none added; the existing query option already governs both scanner phases.
  16. Performance: no extra row scans, data copies, or unbounded buffers. The success path adds a disabled debug-point check and an out-of-line helper call; performance was not benchmarked.
  17. BE conventions and other issues: includes stay in implementation/test files; no new PCH, header-budget, explicit-instantiation, source-including test, or unity-skip obligation is introduced. The final sweep found no additional actionable issue.

Coverage limits: static inspection only. No builds, tests, benchmarks, formatting/hygiene execution, or live Hive/BE verification was performed. Third-party ORC internals were not rebuilt or executed, and external CI invocation flags outside this checkout were not verified. No unresolved source-level candidate or uncovered changed-file scope remains. Review converged in round 1.

Review converged after 1 round(s).

@Gabriel39
Gabriel39 merged commit 122a7db into apache:master Oct 27, 2026
36 checks passed
@suxiaogang223
suxiaogang223 deleted the codex/fix-orc-rowid-seek-exception branch October 27, 2026 08:42
@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 Oct 27, 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