Skip to content

[opt](point query) Reuse segments for point query row data lookup - #67649

Merged
csun5285 merged 7 commits into
apache:masterfrom
zyp-V:reuse_segment_for_pointquery
Oct 26, 2026
Merged

csun5285 merged 7 commits into
apache:masterfrom
zyp-V:reuse_segment_for_pointquery

Conversation

@zyp-V

@zyp-V zyp-V commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Row-store point queries load rowset segments to locate a primary key, then load and search those segments again to read the row data. Return the matched segment from key lookup and retain it in the per-row read context so row-data lookup can use it directly. Keep the existing lookup interface for other callers and preserve the current branch's IOContext. This removes the second segment-loader call and segment scan from the row data stage; no latency or throughput benchmark was run.

Release note

Reduce repeated segment lookups in row-store point queries.

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.
  • 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?

@zyp-V

zyp-V commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@HonestManXin

Copy link
Copy Markdown
Contributor

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

Review status: complete after two convergence rounds. I am requesting changes for two issues: retained-segment reuse drops the loader's unhealthy-object replacement behavior, and the default-enabled partial-row-store path still performs the second segment load/scan that this PR intends to remove.

Checkpoint conclusions:

  • Goal, scope, and performance: the production change is focused and removes the second loader call for healthy full-row-store point queries. Partial row_store_columns queries remain on the redundant path, so the stated optimization is incomplete there.
  • Correctness and conditions: ordinary healthy reads, key misses, delete filtering, row-cache hits, sequence handling, local/cloud identities, and non-contiguous physical segment IDs remain sound. The unhealthy-segment retry regression is blocking.
  • Concurrency and lifecycle: no new thread or lock protocol is introduced. Shared rowset/segment ownership and reverse destruction order are safe across cache eviction and rowset retirement; mutable segment health is the separate boundary that must be restored.
  • Compatibility, configuration, and persistence: the defaulted key-lookup output and retained legacy row-data overload preserve existing callers. There is no new FE/BE variable, wire/storage-format, transaction, or write-path change.
  • Parallel paths and tests: the healthy full-row-store tests cover local/cloud IDs, eviction lifetime, cache hits, misses, deletion, references, output equality, and loader count. Missing coverage is partial row storage and unhealthy replacement, including their composition. Existing profile counters remain applicable, and the new sync-point hook is test-only in production builds.
  • Validation status: per the review environment instructions, I did not build or run tests locally. At submission time the formatter/style checks are green, the external performance check is failing, and BE UT/compile are still pending.
  • User focus: no additional focus was supplied, so the whole PR was reviewed.

Comment thread be/src/storage/tablet/base_tablet.cpp
Comment thread be/src/service/point_query_executor.cpp
@zyp-V
zyp-V force-pushed the reuse_segment_for_pointquery branch from 6f71042 to 6f6e1f8 Compare September 8, 2026 11:56
@zyp-V

zyp-V commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17566	3016	3035	3016
q2	2102	264	226	226
q3	10245	883	524	524
q4	4677	260	205	205
q5	7672	606	391	391
q6	139	120	97	97
q7	543	540	382	382
q8	9238	935	917	917
q9	3474	2437	2383	2383
q10	6512	890	693	693
q11	394	201	182	182
q12	611	264	203	203
q13	18137	1533	1164	1164
q14	158	150	137	137
q15	q16	451	400	368	368
q17	1332	854	716	716
q18	3066	2253	2228	2228
q19	1286	889	781	781
q20	377	293	200	200
q21	5673	1728	1919	1728
q22	327	272	227	227
Total cold run time: 93980 ms
Total hot run time: 16768 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3375	3305	3262	3262
q2	520	392	364	364
q3	2211	2327	2200	2200
q4	1189	1187	892	892
q5	2238	2152	2076	2076
q6	169	123	89	89
q7	1033	936	863	863
q8	1592	1403	1395	1395
q9	3113	3070	3094	3070
q10	1878	1804	1637	1637
q11	357	282	253	253
q12	458	430	342	342
q13	1478	1532	1158	1158
q14	174	170	161	161
q15	q16	405	409	363	363
q17	3524	3334	3215	3215
q18	4836	4424	4707	4424
q19	861	914	912	912
q20	999	973	819	819
q21	3883	3165	3305	3165
q22	410	351	323	323
Total cold run time: 34703 ms
Total hot run time: 30983 ms

@hello-stephen

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

query5	4252	427	346	346
query6	389	146	128	128
query7	4909	415	226	226
query8	307	123	116	116
query9	8686	2960	2949	2949
query10	393	219	188	188
query11	5375	1031	893	893
query12	119	72	72	72
query13	1194	472	316	316
query14	6120	2215	2097	2097
query14_1	1974	1958	1966	1958
query15	177	122	113	113
query16	925	343	380	343
query17	815	455	379	379
query18	2330	327	247	247
query19	169	144	119	119
query20	72	71	71	71
query21	204	103	88	88
query22	5497	5334	5299	5299
query23	6791	6223	5879	5879
query23_1	6095	6145	5962	5962
query24	7268	1091	766	766
query24_1	794	784	805	784
query25	436	311	260	260
query26	1232	233	126	126
query27	2785	407	257	257
query28	4735	1508	1475	1475
query29	933	462	365	365
query30	257	160	135	135
query31	813	408	331	331
query32	135	83	87	83
query33	457	214	188	188
query34	1017	834	493	493
query35	402	413	353	353
query36	588	584	535	535
query37	123	94	77	77
query38	1040	858	851	851
query39	497	490	496	490
query39_1	471	492	451	451
query40	205	93	81	81
query41	61	58	58	58
query42	76	74	73	73
query43	243	241	212	212
query44	1025	555	541	541
query45	111	111	108	108
query46	756	847	552	552
query47	765	773	725	725
query48	323	305	242	242
query49	575	245	195	195
query50	727	270	194	194
query51	7946	7990	7974	7974
query52	70	72	60	60
query53	191	204	152	152
query54	215	184	151	151
query55	84	64	58	58
query56	196	161	152	152
query57	783	641	640	640
query58	188	173	163	163
query59	1208	1184	1081	1081
query60	242	189	182	182
query61	124	132	119	119
query62	340	203	189	189
query63	188	140	136	136
query64	2803	766	623	623
query65	1595	1597	1564	1564
query66	1869	261	204	204
query67	9779	9764	9673	9673
query68	2755	1275	773	773
query69	345	225	199	199
query70	684	619	592	592
query71	254	179	160	160
query72	2314	1683	1525	1525
query73	659	620	352	352
query74	1570	1246	1162	1162
query75	1192	1114	963	963
query76	2286	752	546	546
query77	264	254	218	218
query78	4072	3672	3155	3155
query79	2890	870	577	577
query80	1574	329	265	265
query81	513	157	134	134
query82	601	135	95	95
query83	287	210	189	189
query84	299	109	88	88
query85	828	365	284	284
query86	475	173	180	173
query87	1019	972	915	915
query88	2950	2119	2111	2111
query89	278	198	181	181
query90	2015	135	128	128
query91	130	115	97	97
query92	86	69	69	69
query93	1824	1086	711	711
query94	641	262	237	237
query95	537	328	223	223
query96	806	613	276	276
query97	1084	1052	1003	1003
query98	163	132	134	132
query99	418	354	308	308
Total cold run time: 178707 ms
Total hot run time: 81948 ms

@hello-stephen

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

query1	0.00	0.01	0.00
query2	0.08	0.04	0.04
query3	0.25	0.10	0.10
query4	1.61	0.10	0.10
query5	0.17	0.15	0.16
query6	1.27	0.71	0.68
query7	0.04	0.01	0.00
query8	0.05	0.04	0.03
query9	0.30	0.21	0.22
query10	0.35	0.35	0.34
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.31	0.32	0.31
query14	0.45	0.45	0.45
query15	0.37	0.37	0.34
query16	0.23	0.21	0.24
query17	0.72	0.72	0.63
query18	0.19	0.16	0.17
query19	1.20	1.17	1.16
query20	0.01	0.01	0.01
query21	15.46	0.16	0.13
query22	5.06	0.05	0.04
query23	16.19	0.27	0.10
query24	2.98	0.32	0.27
query25	0.09	0.05	0.04
query26	0.86	0.16	0.11
query27	0.04	0.03	0.03
query28	3.70	0.60	0.27
query29	12.42	3.19	2.57
query30	0.26	0.12	0.12
query31	2.75	0.38	0.17
query32	3.52	0.32	0.23
query33	1.39	1.48	1.47
query34	15.38	2.21	1.80
query35	1.79	1.81	1.78
query36	0.45	0.31	0.30
query37	0.06	0.04	0.04
query38	0.04	0.03	0.03
query39	0.03	0.02	0.03
query40	0.11	0.09	0.08
query41	0.07	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.63 s
Total hot run time: 14.82 s

@zyp-V
zyp-V force-pushed the reuse_segment_for_pointquery branch from 6f6e1f8 to cbe2155 Compare September 9, 2026 07:51
@zyp-V

zyp-V commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.31% (34862/45683)
Line Coverage 61.39% (393343/640720)
Region Coverage 57.56% (330411/573979)
Branch Coverage 58.41% (150959/258437)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17593	3047	3035	3035
q2	2144	261	224	224
q3	10190	867	523	523
q4	4672	268	202	202
q5	7686	575	390	390
q6	143	119	94	94
q7	534	516	399	399
q8	9251	894	955	894
q9	3538	2448	2415	2415
q10	6528	863	723	723
q11	411	197	174	174
q12	664	257	197	197
q13	18203	1555	1152	1152
q14	158	153	141	141
q15	q16	448	400	374	374
q17	1407	826	769	769
q18	3095	2292	2288	2288
q19	1132	898	785	785
q20	360	286	200	200
q21	5344	1688	1828	1688
q22	327	266	234	234
Total cold run time: 93828 ms
Total hot run time: 16901 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3391	3360	3319	3319
q2	515	393	367	367
q3	2293	2303	2178	2178
q4	1209	1199	895	895
q5	2249	2142	2154	2142
q6	172	123	91	91
q7	1033	954	910	910
q8	1589	1397	1406	1397
q9	3214	3202	3201	3201
q10	1938	1837	1655	1655
q11	354	272	259	259
q12	461	436	340	340
q13	1478	1529	1176	1176
q14	170	182	158	158
q15	q16	395	406	360	360
q17	3745	3389	3323	3323
q18	4935	4555	4960	4555
q19	960	871	845	845
q20	1019	987	830	830
q21	3861	3169	3228	3169
q22	393	345	322	322
Total cold run time: 35374 ms
Total hot run time: 31492 ms

@hello-stephen

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

query5	4241	395	328	328
query6	397	138	125	125
query7	4958	422	231	231
query8	290	121	123	121
query9	8679	2877	2881	2877
query10	387	223	203	203
query11	5385	1053	921	921
query12	124	73	70	70
query13	1189	428	293	293
query14	6114	2235	2138	2138
query14_1	2019	2003	2002	2002
query15	175	121	112	112
query16	912	378	361	361
query17	812	463	379	379
query18	2332	311	237	237
query19	156	132	109	109
query20	86	67	72	67
query21	203	98	84	84
query22	5546	5373	5408	5373
query23	6957	6380	6335	6335
query23_1	6429	6064	6165	6064
query24	7249	1074	748	748
query24_1	765	754	779	754
query25	447	267	237	237
query26	1230	228	132	132
query27	2787	410	251	251
query28	4731	1504	1479	1479
query29	901	423	329	329
query30	255	154	128	128
query31	820	411	333	333
query32	130	73	79	73
query33	456	224	174	174
query34	980	853	470	470
query35	408	407	338	338
query36	575	542	532	532
query37	120	81	69	69
query38	1014	868	848	848
query39	509	489	471	471
query39_1	463	450	471	450
query40	200	88	74	74
query41	54	51	51	51
query42	73	76	72	72
query43	244	238	210	210
query44	1002	535	533	533
query45	108	110	109	109
query46	822	846	537	537
query47	775	770	715	715
query48	315	298	238	238
query49	541	240	199	199
query50	736	278	201	201
query51	8011	7881	8062	7881
query52	69	75	61	61
query53	192	203	151	151
query54	234	209	156	156
query55	78	61	58	58
query56	203	165	186	165
query57	740	680	665	665
query58	211	171	175	171
query59	1261	1280	1130	1130
query60	232	180	185	180
query61	104	133	109	109
query62	353	197	179	179
query63	170	144	136	136
query64	2652	661	629	629
query65	1670	1625	1670	1625
query66	1889	251	209	209
query67	10127	10064	9983	9983
query68	3023	1119	675	675
query69	358	216	196	196
query70	665	621	595	595
query71	255	169	162	162
query72	2305	1443	1486	1443
query73	656	576	337	337
query74	2004	1252	1157	1157
query75	1211	1108	965	965
query76	2379	730	524	524
query77	263	258	211	211
query78	4198	3831	3345	3345
query79	2317	815	592	592
query80	1580	317	266	266
query81	496	161	136	136
query82	597	127	96	96
query83	280	207	191	191
query84	288	110	90	90
query85	765	350	281	281
query86	380	178	170	170
query87	1034	986	923	923
query88	2794	2132	2112	2112
query89	282	197	177	177
query90	2003	124	126	124
query91	134	116	94	94
query92	77	71	65	65
query93	1451	1130	737	737
query94	649	268	230	230
query95	508	311	231	231
query96	825	555	260	260
query97	1108	1115	1058	1058
query98	319	133	132	132
query99	426	352	310	310
Total cold run time: 179359 ms
Total hot run time: 82738 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.08	0.04	0.04
query3	0.26	0.11	0.10
query4	1.60	0.10	0.09
query5	0.17	0.15	0.16
query6	1.26	0.70	0.68
query7	0.03	0.01	0.00
query8	0.04	0.03	0.04
query9	0.28	0.22	0.22
query10	0.34	0.36	0.36
query11	0.16	0.12	0.12
query12	0.18	0.12	0.12
query13	0.32	0.32	0.32
query14	0.46	0.45	0.46
query15	0.38	0.35	0.35
query16	0.22	0.22	0.21
query17	0.75	0.70	0.73
query18	0.19	0.17	0.17
query19	1.22	1.14	1.18
query20	0.02	0.01	0.01
query21	15.46	0.16	0.11
query22	5.08	0.05	0.05
query23	16.16	0.25	0.12
query24	3.05	0.32	0.26
query25	0.11	0.03	0.04
query26	0.73	0.17	0.12
query27	0.04	0.03	0.03
query28	3.63	0.57	0.25
query29	12.48	3.22	2.57
query30	0.25	0.10	0.12
query31	2.76	0.39	0.18
query32	3.52	0.33	0.25
query33	1.42	1.50	1.65
query34	15.38	2.22	1.83
query35	1.81	1.74	1.77
query36	0.47	0.29	0.29
query37	0.06	0.04	0.04
query38	0.05	0.03	0.02
query39	0.03	0.02	0.03
query40	0.11	0.08	0.07
query41	0.07	0.02	0.03
query42	0.03	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 90.71 s
Total hot run time: 14.91 s

@eldenmoon

Copy link
Copy Markdown
Member

/review

eldenmoon
eldenmoon previously approved these changes Sep 11, 2026

@eldenmoon eldenmoon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Review status: complete after one convergence round at cbe215506c408a70f0e959b8d1ce61e597620d23. I am requesting changes because the two existing inline issues remain unresolved on this head; I am not duplicating those threads.

  • P1 unhealthy replacement: the retained-segment overload bypasses SegmentLoader::load_segment()'s completed-unhealthy check/replacement. A failure recorded by lazy column-metadata initialization between key lookup and row-data lookup is replayed by direct use, whereas the previous loader-backed path could replace the failed object. The later-race possibility mentioned in the reply does not remove this completed-before-check regression; the healthy hot path can remain direct while only non-healthy segments fall back to the loader.
  • P2 partial/no-row-store fallback: when missing_col_uids is nonempty, the executor still reacquires the rowset, calls load_segments, and scans by physical ID instead of using the acquired rowset and retained or health-replaced Segment. Besides leaving the claimed optimization incomplete, same-version rowset replacement can remove the old rowset from the active/stale maps even though this context still owns it.

Checkpoint conclusions:

  • Goal, scope, and performance: the production change is focused and removes the second loader call for healthy full-row-store point queries. It does not complete that goal for partial row_store_columns or column-store-only fallback.
  • Correctness, conditions, and error handling: healthy reads, cache hits, key misses, delete filtering, sequence continuation, nullable output, Status propagation, local IDs, and noncontiguous cloud physical IDs are sound. The unresolved P1 changes recovery behavior for an already-failed cached Segment.
  • Concurrency and lifecycle: no new thread or lock protocol is introduced. The retained shared_ptr, paired rowset identity, cache-eviction lifetime, and reverse member destruction order are correct; mutable Segment health and the separate map reacquisition are the two unresolved boundaries above.
  • Compatibility, configuration, persistence, and writes: the trailing default output and legacy overload preserve current callers. There is no FE/BE variable, RPC/storage-format, dynamic configuration, transaction, persistence, or data-write change.
  • Parallel paths and tests: current tests cover healthy full-row-store reuse, local/cloud-style IDs, same physical IDs across rowsets, eviction, reader references, row-cache hits, misses, deletion, output equality, and loader counts. They still need deterministic unhealthy-replacement and partial/no-row-store mixed-source coverage.
  • Validation: review remained static as required by this runner. build-support/check-build-hygiene.sh passed, and the live current-head COMPILE and BE UT checks are green.
  • Observability: existing point-query timers, read statistics, and slow-query logging remain applicable; no new metric is required for this internal handoff.
  • User focus: no additional focus was supplied, so the complete PR was reviewed.

No new inline comments are included because every substantiated issue is already covered by the two live threads above.

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Row-store point queries load rowset segments to locate a
primary key, then load and search those segments again to read the row data.
Return the matched segment from key lookup and retain it in the per-row read
context so row-data lookup can use it directly. Keep the existing lookup
interface for other callers and preserve the current branch's IOContext.
This removes the second segment-loader call and segment scan from the row
data stage; no latency or throughput benchmark was run.

Adapt the source change to BaseTablet and typed RowCursor fields. Port the
segment identity, loader-call count and row-data equality assertions, and
cover cache eviction and deleted keys as well.

Backported-from: 8c574d56ef1918693406bdea86c51eb26d657b3d

### Release note

Reduce repeated segment lookups in row-store point queries.

### Check List (For Author)

- Test: Manual review, clang-format 16, build hygiene and git diff --check passed.
    - Unit Test: ASAN BE build and SegmentCacheTest attempted; compilation is
      blocked by installed Thrift 0.16 lacking TOutput::instance(), while this
      branch requires Thrift 0.24. No runtime tests completed.
    - Static analysis: clang-tidy attempted; existing unmatched NOLINTEND in
      be/src/core/types.h prevents a passing result.
- Behavior changed: No (query results and wire/storage formats are unchanged)
- Does this need documentation: No
@zyp-V

zyp-V commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17661	3897	3881	3881
q2	2189	387	312	312
q3	10062	1395	800	800
q4	4686	482	356	356
q5	7475	846	553	553
q6	178	171	135	135
q7	755	782	609	609
q8	9301	1659	1634	1634
q9	5578	4244	4225	4225
q10	6815	1317	1025	1025
q11	446	272	246	246
q12	633	416	308	308
q13	18050	2617	2030	2030
q14	267	260	235	235
q15	q16	744	718	661	661
q17	1712	1186	1119	1119
q18	6433	5595	5562	5562
q19	1167	1211	1066	1066
q20	463	388	267	267
q21	5339	3009	2714	2714
q22	426	344	301	301
Total cold run time: 100380 ms
Total hot run time: 28039 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4206	4035	4057	4035
q2	715	556	507	507
q3	4462	4864	4314	4314
q4	2238	2312	1455	1455
q5	4207	4119	4070	4070
q6	224	171	124	124
q7	1726	1614	1447	1447
q8	2190	2475	2189	2189
q9	7521	7616	7584	7584
q10	4025	3667	3219	3219
q11	556	415	359	359
q12	739	748	522	522
q13	2425	2879	2151	2151
q14	282	306	271	271
q15	q16	707	710	636	636
q17	7839	7173	7075	7075
q18	12036	11253	11889	11253
q19	1217	1085	1075	1075
q20	2236	2230	1918	1918
q21	5391	4413	4522	4413
q22	530	485	443	443
Total cold run time: 65472 ms
Total hot run time: 59060 ms

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Review recovery stopped: No final review submission was declared
Workflow run: https://github.com/apache/doris/actions/runs/39566900565

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

@csun5285

Copy link
Copy Markdown
Contributor

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Review recovery stopped: No final review submission was declared
Workflow run: https://github.com/apache/doris/actions/runs/39576592585

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

hello-stephen pushed a commit that referenced this pull request Oct 21, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: #67649

When an automated review reconfirms an existing blocker whose heading
starts with `**[P1] ...**` or `**[P1]** ...`, `submit_review.py` rejects
the historical comment before posting the final review. This caused [run
39532829872](https://github.com/apache/doris/actions/runs/39532829872)
and [run
39535990055](https://github.com/apache/doris/actions/runs/39535990055)
to finish without delivering a review.

Normalize the leading bold priority markup only when counting explicitly
reconfirmed existing comments. New findings retain their strict format.
Existing P0/P1 findings still request changes without duplicate inline
comments, and existing P2/P3 findings remain invalid as blockers.

### Release note

None

### Check List (For Author)

- Test:
- [x] Unit Test: `test_submit_review.py` — 40 passed;
`test_run_review_with_resume.py` — 78 passed, 3 Linux-only tests skipped
on macOS; `test_resolve_code_review_status.py` — 20 passed.
- [x] Manual test: the new bold-comment cases fail against the original
implementation. `git diff --check` passes.
- Coverage includes P0/P1 counts, exact readback, repeated submission
without reposting, rejection of P2/P3 and malformed or reply comments,
and strict validation of new findings. GitHub API calls are mocked.
- Behavior changed:
- [x] Yes. Existing review comments with bold priority headings can be
reconfirmed and delivered.
- Does this need documentation?
    - [x] 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

BE Regression && UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.23% (35875/46455)
Line Coverage 62.50% (405104/648130)
Region Coverage 59.10% (342903/580204)
Branch Coverage 59.98% (158430/264152)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17610	5271	5114	5114
q2	2134	338	257	257
q3	10201	1399	853	853
q4	4677	464	338	338
q5	7449	804	532	532
q6	186	182	160	160
q7	768	822	606	606
q8	9248	1346	1125	1125
q9	5543	4205	4221	4205
q10	6839	1288	1036	1036
q11	420	251	230	230
q12	636	403	304	304
q13	18085	3629	3032	3032
q14	284	271	244	244
q15	q16	746	710	682	682
q17	1214	749	589	589
q18	7126	6225	6135	6135
q19	1251	984	611	611
q20	394	340	230	230
q21	5375	2168	2327	2168
q22	351	307	247	247
Total cold run time: 100537 ms
Total hot run time: 28698 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5635	5584	5627	5584
q2	680	609	545	545
q3	5225	5400	4927	4927
q4	2009	2146	1562	1562
q5	5298	5161	5852	5161
q6	254	193	149	149
q7	2390	2116	1901	1901
q8	3101	2940	2732	2732
q9	8169	8142	7934	7934
q10	3723	3678	3274	3274
q11	602	434	417	417
q12	695	675	546	546
q13	3511	3843	3426	3426
q14	302	327	314	314
q15	q16	712	729	669	669
q17	8171	7542	7366	7366
q18	13073	12329	12895	12329
q19	926	797	798	797
q20	2169	2153	1956	1956
q21	5630	4576	4745	4576
q22	481	444	414	414
Total cold run time: 72756 ms
Total hot run time: 66579 ms

@hello-stephen

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

query5	4309	612	449	449
query6	425	212	200	200
query7	4807	465	226	226
query8	330	174	151	151
query9	8764	3093	3087	3087
query10	481	332	273	273
query11	6036	3925	3633	3633
query12	153	96	89	89
query13	1253	456	316	316
query14	6141	4054	3751	3751
query14_1	3515	3515	3568	3515
query15	213	203	180	180
query16	981	437	413	413
query17	895	687	554	554
query18	2439	438	314	314
query19	198	168	144	144
query20	91	89	87	87
query21	218	135	110	110
query22	13057	13120	12862	12862
query23	13415	12899	12557	12557
query23_1	12629	12509	12561	12509
query24	7386	858	476	476
query24_1	494	488	483	483
query25	544	443	374	374
query26	1266	279	148	148
query27	2727	465	279	279
query28	4602	1935	1940	1935
query29	1572	636	460	460
query30	308	223	190	190
query31	1026	946	839	839
query32	167	99	95	95
query33	537	316	258	258
query34	925	911	501	501
query35	742	765	653	653
query36	803	794	716	716
query37	124	99	86	86
query38	1789	1734	1652	1652
query39	803	822	749	749
query39_1	730	744	738	738
query40	217	119	97	97
query41	66	64	60	60
query42	92	88	84	84
query43	359	378	334	334
query44	1358	680	691	680
query45	178	176	169	169
query46	889	1034	591	591
query47	2852	2972	2779	2779
query48	289	317	219	219
query49	579	412	309	309
query50	705	288	204	204
query51	10484	10488	10491	10488
query52	79	84	71	71
query53	194	221	156	156
query54	242	190	192	190
query55	118	70	66	66
query56	260	220	228	220
query57	1646	1634	1556	1556
query58	299	268	266	266
query59	2137	2157	1971	1971
query60	324	255	236	236
query61	152	152	150	150
query62	400	341	294	294
query63	204	164	165	164
query64	2721	987	777	777
query65	3390	3309	3320	3309
query66	1781	453	309	309
query67	20297	20280	19955	19955
query68	2978	1008	609	609
query69	397	288	267	267
query70	847	816	791	791
query71	315	239	227	227
query72	2758	2576	2345	2345
query73	534	554	297	297
query74	4699	4545	4345	4345
query75	2470	2399	1973	1973
query76	2316	1116	623	623
query77	358	404	283	283
query78	10066	9789	9186	9186
query79	1025	893	530	530
query80	579	455	382	382
query81	548	333	283	283
query82	890	136	109	109
query83	326	208	193	193
query84	325	129	108	108
query85	918	443	397	397
query86	346	244	226	226
query87	2003	1964	1820	1820
query88	3663	2680	2647	2647
query89	361	308	258	258
query90	1898	179	176	176
query91	162	152	135	135
query92	102	90	92	90
query93	1044	1021	577	577
query94	451	327	286	286
query95	591	336	306	306
query96	678	492	233	233
query97	2474	2432	2333	2333
query98	166	157	159	157
query99	767	762	639	639
Total cold run time: 235934 ms
Total hot run time: 152106 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.09	0.05	0.05
query3	0.27	0.09	0.09
query4	1.60	0.10	0.11
query5	0.27	0.25	0.26
query6	1.18	0.68	0.70
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.41	0.33	0.36
query10	0.59	0.62	0.61
query11	0.20	0.13	0.14
query12	0.18	0.15	0.15
query13	0.51	0.51	0.51
query14	1.03	1.02	1.01
query15	0.63	0.60	0.60
query16	0.31	0.36	0.36
query17	1.11	1.11	1.10
query18	0.20	0.19	0.19
query19	2.08	2.01	1.99
query20	0.02	0.01	0.01
query21	15.52	0.19	0.13
query22	4.93	0.05	0.05
query23	16.26	0.32	0.12
query24	2.98	0.66	0.37
query25	0.12	0.09	0.05
query26	1.52	0.22	0.16
query27	0.06	0.05	0.04
query28	3.65	0.75	0.36
query29	12.51	4.07	3.25
query30	0.29	0.14	0.11
query31	2.78	0.57	0.33
query32	3.23	0.60	0.51
query33	3.13	3.26	3.25
query34	15.32	4.00	3.41
query35	3.36	3.35	3.39
query36	0.57	0.44	0.48
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.14
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 97.54 s
Total hot run time: 24.5 s

@shuke987

Copy link
Copy Markdown
Contributor

/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 all seven changed files at c343cf2. Request changes because the existing P1 remains applicable; no new inline findings were identified.

Existing findings independently revalidated:

  • P1: unhealthy-segment replacement remains unresolved. Key lookup initializes the primary-key index/Bloom filter without initializing column metadata. A concurrent reader can then store a transient footer/metadata failure in the retained segment's DorisCallOnce state. The new direct row-data path replays that failure; the previous loader path checks healthy_status and can replace the failed segment. The author's observation that failure can also occur after a health check does not eliminate recovery for a failure already present before that check. Carrying existing blocking comment 3956640174; no duplicate posted.
  • P2: partial-row-store loading also remains applicable. Missing-column reads still load and search segments again. This is already reported and is not duplicated.

The reviewed flow is: request -> row-cache probe or key lookup -> retain matched segment and acquire rowset -> row-data iterator -> output -> release segment before rowset.

Critical checkpoint conclusions:

  1. Goal and proof: healthy full-row-store reads avoid the second loader call/segment search; new unit assertions check call counts and returned values. The existing P1/P2 limit correctness recovery and optimization coverage respectively. No latency or throughput measurement was supplied.
  2. Scope: focused additive API/context changes with a shared row-data helper and two test files.
  3. Concurrency and locks: per-request stages are sequential, while cached segments are shared with other readers. The health-state regression above remains; no new lock order or heavy work under a new lock was found.
  4. Lifecycle and static initialization: retained shared ownership survives cache eviction; rowset acquire/release and reverse member destruction preserve lifetime on success/error. Metadata accounting remains object-owned. No ownership cycle or new cross-TU initialization dependency was found.
  5. Configuration: no production configuration added; modified test flags and substituted singleton pointers are restored.
  6. Compatibility: legacy row-data overload and defaulted trailing key-lookup output preserve source callers. No wire/storage-format or dependency/libc-API changes; final ELF/glibc compatibility was not validated in this static review.
  7. Thrift/protobuf: unchanged; field-ID review is not applicable.
  8. Parallel paths: row-cache hits and legacy callers remain; partial/absent row-store reloads are the existing P2. Local contiguous and cloud noncontiguous physical segment IDs are covered by the added cases.
  9. Conditions and errors: optional segment selection and caller assertions are clear; Status propagation and IOContext/version/commit_tso setup remain shared. The omitted health gate is the existing P1.
  10. Coverage: inspected tests cover multiple rowsets/segments, repeated segment use, nulls, missing/deleted keys, eviction, reader-reference release, legacy/direct payload equality and cold/warm row-cache behavior. Unhealthy-transition and partial-row-store cases remain absent. Builds, tests and benchmarks were not run, as required by this review contract.
  11. Expected results: inserted values, nullable output and MySQL cell encodings match the assertions by inspection; no regression output files changed.
  12. Observability: existing statistics, timers and error reporting are reused; the added counting sync point is test/injection gated.
  13. Transactions and persistence: no persistence/replay/failover protocol changes; existing rowset and delete-bitmap selection are retained.
  14. Writes and crash cleanup: production changes are read-only; request-owned RAII cleanup introduces no new durable state.
  15. FE/BE variables: none added; no protocol send-path updates required.
  16. Performance: healthy row-store reads remove redundant loader traversal/search; partial-row-store repetition remains the existing P2. Segment ownership lasts for the request.
  17. Other checks: no new PCH/hub-header dependencies, explicit template families, source-including tests or hygiene-table changes; no further distinct issue substantiated.

User focus: no additional focus was supplied. Coverage is complete for the supplied diff and related read/lifetime/error paths through static inspection; runtime recovery, execution of added tests, final release ELF compatibility and measured performance remain unvalidated.

Review converged after 2 round(s).

Existing P0/P1 findings confirmed for this head: #67649 (comment)

@zyp-V

zyp-V commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

/review

@csun5285 这个 P1 对于点查来说我觉得是允许的, 而且目前这个改动路径只有点查会走到, 因为下一次 rpc 点查还会做健康检查的, 原来的写法只是防守 lookup key 的时候 segment 是好的, lookup data segment 不健康的情况, 所以中间加了一次 load segments 做健康检查;

@csun5285

Copy link
Copy Markdown
Contributor

run buildall

@csun5285

Copy link
Copy Markdown
Contributor

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

Changes requested: the previously reported P1 health-replacement regression still applies to ec73ba4. No additional distinct findings were verified across the seven changed files; existing threads are not reposted.

Existing findings independently revalidated:

  • P1: Preserve unhealthy-segment replacement before reuse. Key lookup loads the PK index/BF without necessarily initializing column metadata. Another scan can record a transient footer/metadata failure in the retained Segment's DorisCallOnce before this query's data stage. The new direct path replays that stored failure; the previous loader path would detect the already-unhealthy instance and replace it. The author's observation that a later race can still occur after a health check does not address this lost recovery case. This comment remains the existing blocker.
  • P2: Reuse the retained segment in the missing-column path. Partial row-store queries still enter the following missing-column branch, reload rowset segments, and scan for the same physical ID. Both new fixtures use full-row storage, so their loader-count assertions do not cover this branch. This remains covered by the existing thread.

Invocation and ownership reviewed: RPC worker -> executor init -> sequential key lookup -> retained location/Segment/acquired rowset -> row-store and optional missing-column reads -> result serialization -> context teardown. Other queries can concurrently use the shared cached Segment.

Critical checkpoint conclusions:

Checkpoint Conclusion
Goal and proof Healthy full-row reads avoid the second loader call/scan. Added unit assertions cover this and output values; E1/E2 prevent full goal satisfaction. Tests were inspected, not run.
Scope and reuse Production changes are focused; old row-data overload and shared iterator initialization are retained.
Concurrency and locks Per-executor stages are sequential; shared Segment metadata initialization can race with another scan (E1). Rowset snapshot capture remains under the header lock, with IO outside it. No new locks, nesting, threads, or deadlock mechanism found.
Lifecycle and memory The context releases its Segment before its acquired rowset. Shared rowset ownership prevents local GC deletion. SegmentCacheHandle already retains shared_ptrs after releasing LRU handles; the new owner follows that model. Metadata accounting and weak, identity-checked cache callbacks remain intact. No ownership cycle or new static-initialization dependency found.
Configuration No configuration item added or changed; dynamic-setting behavior is unchanged.
Compatibility The original row-data entry point remains; the key-lookup output is a defaulted trailing argument. No storage/wire format or rolling-upgrade change. No new libc API identified; final ELF compatibility was not audited.
Thrift/protobuf No generated definition changes.
Parallel paths Local contiguous and cloud explicit/legacy segment IDs retain correct physical identity; vector positions are used only to select the matched object. Mixed/column-store repeated loading is E2. Existing write and rowid-fetcher callers retain prior behavior.
Conditional checks Optional output/direct-path checks match the API contract; segment output is set only after key/delete-bitmap acceptance. No additional conditional-path defect found.
Test coverage New tests cover missing/deleted keys, NULL values, multiple rowsets/segments, offset row IDs, local/noncontiguous cloud layouts, eviction/lifetime, legacy equality, loader counts and row-cache results. Unhealthy replacement and mixed-source cases remain absent as already covered by E1/E2. Fixture setup, writer use, global cache restoration and teardown were checked statically.
Test results No golden-result files changed. Expected row values and serialized NULL bytes are consistent with the inspected code; execution remains unverified.
Observability Existing timers, stats, logs and IOContext propagation remain. Test instrumentation is scoped and disabled in ordinary builds; no additional observability defect found.
Transaction/persistence/failover Production changes add no writes or persistent metadata; rowset version/commit context and delete-bitmap acceptance remain on the same path. No new failover protocol.
Write atomicity/crash behavior No production write or atomicity change. Normal/error ownership cleanup and GC protection retain their existing mechanisms.
FE-BE variables No new transmitted variable or sending path.
Performance The healthy full-row fast path removes intended redundant work; partial-row-store work remains E2. No latency/throughput benchmark was run or improvement amount inferred.
Other correctness/errors Same located rowset/physical segment and row ID are retained; iterator/read Status and RPC exception conversion remain. No additional distinct wrong-result or error-handling issue verified beyond E1.

No additional user focus was supplied. Static review covers the entire supplied diff and relevant upstream/downstream paths; there are no unresolved static candidates. No builds, tests, formatting/static-analysis tools, benchmarks, remote cloud runs, or release-artifact ABI audits were performed under the review-only contract. Cloud tests model segment-list layout using local files; runtime race/recovery and mixed-source coverage limitations are stated above.

Review converged after 2 round(s).

Existing P0/P1 findings confirmed for this head: #67649 (comment)

@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 ec73ba43028d9f5364c3a659e24a3fbe6888b570, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17575	5189	5098	5098
q2	2189	306	260	260
q3	10202	1427	829	829
q4	4675	473	341	341
q5	7456	804	528	528
q6	181	186	155	155
q7	740	792	591	591
q8	9260	1382	1062	1062
q9	5437	4213	4201	4201
q10	6862	1287	1033	1033
q11	432	254	235	235
q12	639	410	290	290
q13	18098	3558	3004	3004
q14	274	271	248	248
q15	q16	721	717	669	669
q17	1207	765	571	571
q18	7063	6178	6119	6119
q19	1108	956	602	602
q20	413	345	230	230
q21	4735	2146	2303	2146
q22	348	303	256	256
Total cold run time: 99615 ms
Total hot run time: 28468 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5667	5604	5675	5604
q2	688	594	537	537
q3	5234	5356	4885	4885
q4	2000	2143	1568	1568
q5	5276	5218	5634	5218
q6	250	204	155	155
q7	2267	2087	1911	1911
q8	3034	2743	2686	2686
q9	8085	8022	7974	7974
q10	3747	3671	3222	3222
q11	751	478	425	425
q12	707	706	542	542
q13	3576	3932	3188	3188
q14	324	344	299	299
q15	q16	706	716	656	656
q17	8460	7462	6883	6883
q18	13039	12136	13001	12136
q19	954	853	848	848
q20	2152	2130	1916	1916
q21	5784	4685	4725	4685
q22	525	454	408	408
Total cold run time: 73226 ms
Total hot run time: 65746 ms

@hello-stephen

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

query5	4305	590	440	440
query6	431	206	194	194
query7	4803	443	222	222
query8	320	165	147	147
query9	8796	3122	3103	3103
query10	481	286	260	260
query11	6031	3841	3578	3578
query12	151	91	86	86
query13	1262	420	306	306
query14	6105	3892	3638	3638
query14_1	3410	3436	3410	3410
query15	209	201	183	183
query16	946	431	398	398
query17	864	667	538	538
query18	2433	429	310	310
query19	204	186	137	137
query20	85	85	83	83
query21	213	127	104	104
query22	12930	12967	12823	12823
query23	13453	12850	12593	12593
query23_1	12611	12449	12513	12449
query24	7398	831	462	462
query24_1	482	504	475	475
query25	506	391	337	337
query26	1282	253	133	133
query27	2768	437	266	266
query28	4649	1945	1931	1931
query29	1530	574	429	429
query30	297	216	182	182
query31	1010	919	803	803
query32	141	86	86	86
query33	537	292	231	231
query34	940	853	497	497
query35	721	753	647	647
query36	824	804	718	718
query37	121	91	79	79
query38	1783	1747	1665	1665
query39	794	782	740	740
query39_1	728	730	737	730
query40	220	113	93	93
query41	66	64	62	62
query42	87	84	83	83
query43	342	361	305	305
query44	1294	679	683	679
query45	179	178	165	165
query46	818	962	559	559
query47	2709	2946	2674	2674
query48	291	301	217	217
query49	596	397	315	315
query50	661	267	205	205
query51	10382	10250	10190	10190
query52	77	78	69	69
query53	182	205	149	149
query54	229	193	178	178
query55	72	66	63	63
query56	244	208	196	196
query57	1661	1642	1555	1555
query58	283	274	264	264
query59	2173	2254	1932	1932
query60	308	240	226	226
query61	147	140	135	135
query62	413	334	280	280
query63	186	152	152	152
query64	2727	916	775	775
query65	3348	3283	3271	3271
query66	1775	420	295	295
query67	20230	20032	19963	19963
query68	3043	1001	595	595
query69	378	282	249	249
query70	833	768	761	761
query71	307	231	213	213
query72	2712	2571	2308	2308
query73	506	521	293	293
query74	4614	4492	4351	4351
query75	2323	2315	1907	1907
query76	2321	1003	595	595
query77	341	375	270	270
query78	9816	9698	9116	9116
query79	872	843	519	519
query80	475	411	331	331
query81	515	320	270	270
query82	201	136	106	106
query83	189	194	182	182
query84	287	118	99	99
query85	768	418	361	361
query86	261	237	230	230
query87	1976	1924	1806	1806
query88	3556	2642	2620	2620
query89	312	274	241	241
query90	2106	168	160	160
query91	160	150	126	126
query92	97	84	83	83
query93	985	990	563	563
query94	436	312	271	271
query95	564	328	346	328
query96	663	483	235	235
query97	2441	2438	2350	2350
query98	196	149	158	149
query99	756	751	653	653
Total cold run time: 233102 ms
Total hot run time: 150155 ms

@hello-stephen

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

query1	0.00	0.01	0.01
query2	0.09	0.05	0.04
query3	0.26	0.09	0.09
query4	1.61	0.10	0.10
query5	0.23	0.24	0.26
query6	1.18	0.69	0.68
query7	0.04	0.00	0.00
query8	0.05	0.04	0.04
query9	0.40	0.35	0.36
query10	0.57	0.57	0.58
query11	0.20	0.14	0.13
query12	0.17	0.15	0.14
query13	0.47	0.49	0.49
query14	1.03	1.01	1.02
query15	0.63	0.61	0.61
query16	0.36	0.35	0.35
query17	1.18	1.13	1.09
query18	0.22	0.18	0.19
query19	2.06	1.98	2.02
query20	0.02	0.02	0.01
query21	15.45	0.19	0.13
query22	4.90	0.05	0.04
query23	16.32	0.33	0.12
query24	3.14	0.66	0.33
query25	0.10	0.05	0.05
query26	0.88	0.21	0.16
query27	0.05	0.06	0.03
query28	3.27	0.77	0.36
query29	12.47	4.15	3.25
query30	0.28	0.12	0.09
query31	2.77	0.58	0.32
query32	3.23	0.59	0.51
query33	3.16	3.28	3.33
query34	15.33	3.96	3.38
query35	3.36	3.34	3.32
query36	0.55	0.45	0.44
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.18	0.15	0.14
query41	0.09	0.03	0.03
query42	0.04	0.02	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.55 s
Total hot run time: 24.26 s

@zyp-V

zyp-V commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17630	5141	5081	5081
q2	2106	355	259	259
q3	10203	1388	822	822
q4	4681	467	333	333
q5	7437	786	530	530
q6	179	182	152	152
q7	755	806	605	605
q8	9250	1335	1202	1202
q9	5632	4225	4207	4207
q10	6827	1305	1029	1029
q11	426	245	227	227
q12	645	396	283	283
q13	18112	3573	3016	3016
q14	272	268	248	248
q15	q16	711	724	643	643
q17	1191	751	565	565
q18	6937	6187	6101	6101
q19	1114	980	609	609
q20	364	330	227	227
q21	4417	2092	2248	2092
q22	355	299	257	257
Total cold run time: 99244 ms
Total hot run time: 28488 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5637	5604	5591	5591
q2	689	580	514	514
q3	5221	5389	4891	4891
q4	2004	2173	1536	1536
q5	5263	5127	5452	5127
q6	250	206	166	166
q7	2404	2027	1844	1844
q8	3064	2651	2724	2651
q9	8141	7859	7962	7859
q10	3780	3681	3305	3305
q11	617	423	532	423
q12	702	712	519	519
q13	3557	3872	3242	3242
q14	325	333	289	289
q15	q16	708	744	648	648
q17	8276	7570	6920	6920
q18	12976	12151	12810	12151
q19	915	774	782	774
q20	2156	2137	1888	1888
q21	5709	4625	4674	4625
q22	493	447	404	404
Total cold run time: 72887 ms
Total hot run time: 65367 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.29% (35980/46554)
Line Coverage 62.57% (406573/649777)
Region Coverage 59.15% (344315/582114)
Branch Coverage 60.04% (159007/264846)

@hello-stephen

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

query5	4316	592	444	444
query6	426	210	194	194
query7	4822	440	232	232
query8	340	171	164	164
query9	8762	3121	3122	3121
query10	464	313	269	269
query11	5946	3840	3585	3585
query12	146	90	89	89
query13	1235	448	317	317
query14	6104	3933	3627	3627
query14_1	3390	3408	3387	3387
query15	207	199	186	186
query16	929	436	394	394
query17	846	643	512	512
query18	2410	434	301	301
query19	184	158	133	133
query20	84	89	85	85
query21	205	124	103	103
query22	13001	12952	12852	12852
query23	13539	12676	12519	12519
query23_1	12408	12468	12429	12429
query24	7359	842	450	450
query24_1	471	456	459	456
query25	514	419	367	367
query26	1253	258	143	143
query27	2768	439	275	275
query28	4606	1924	1922	1922
query29	1536	586	435	435
query30	308	220	180	180
query31	1003	919	816	816
query32	142	87	88	87
query33	532	290	225	225
query34	888	849	491	491
query35	753	744	644	644
query36	811	782	719	719
query37	116	97	80	80
query38	1771	1733	1677	1677
query39	789	794	748	748
query39_1	738	728	756	728
query40	213	110	92	92
query41	65	63	61	61
query42	94	86	91	86
query43	345	362	310	310
query44	1327	684	691	684
query45	173	178	161	161
query46	855	974	563	563
query47	2856	2784	2767	2767
query48	293	311	224	224
query49	574	400	290	290
query50	693	271	210	210
query51	10347	10487	10480	10480
query52	88	91	70	70
query53	186	212	144	144
query54	249	193	179	179
query55	71	67	62	62
query56	224	223	207	207
query57	1646	1608	1555	1555
query58	285	275	268	268
query59	2064	2194	1942	1942
query60	285	255	271	255
query61	147	137	144	137
query62	381	351	278	278
query63	196	157	164	157
query64	2721	951	760	760
query65	3348	3296	3268	3268
query66	1767	433	297	297
query67	20010	19982	19852	19852
query68	2976	1025	614	614
query69	388	285	247	247
query70	829	766	771	766
query71	301	241	196	196
query72	2692	2670	2416	2416
query73	537	536	300	300
query74	4685	4541	4325	4325
query75	2309	2322	1912	1912
query76	2309	1029	623	623
query77	353	378	278	278
query78	9678	9750	9157	9157
query79	888	891	537	537
query80	512	474	379	379
query81	532	325	277	277
query82	209	139	119	119
query83	206	200	197	197
query84	303	140	109	109
query85	832	497	488	488
query86	260	239	227	227
query87	2014	1995	1800	1800
query88	3590	2671	2659	2659
query89	322	276	239	239
query90	2102	173	161	161
query91	158	156	127	127
query92	100	87	95	87
query93	1019	1012	567	567
query94	439	312	272	272
query95	561	325	365	325
query96	664	498	232	232
query97	2449	2447	2314	2314
query98	162	149	151	149
query99	759	757	644	644
Total cold run time: 232487 ms
Total hot run time: 150870 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.09	0.05	0.06
query3	0.27	0.09	0.09
query4	1.60	0.09	0.10
query5	0.24	0.24	0.24
query6	1.17	0.70	0.68
query7	0.04	0.01	0.00
query8	0.05	0.04	0.04
query9	0.41	0.36	0.33
query10	0.59	0.57	0.59
query11	0.21	0.14	0.14
query12	0.19	0.15	0.15
query13	0.50	0.49	0.49
query14	1.02	1.00	1.02
query15	0.62	0.60	0.61
query16	0.34	0.35	0.34
query17	1.11	1.18	1.13
query18	0.20	0.19	0.20
query19	2.08	1.95	1.94
query20	0.02	0.01	0.01
query21	15.50	0.19	0.13
query22	4.95	0.05	0.06
query23	16.27	0.33	0.12
query24	2.97	0.57	0.44
query25	0.10	0.07	0.06
query26	1.55	0.22	0.16
query27	0.05	0.05	0.06
query28	3.94	0.79	0.37
query29	12.50	4.14	3.30
query30	0.28	0.13	0.11
query31	2.77	0.56	0.33
query32	3.22	0.61	0.50
query33	3.21	3.27	3.18
query34	15.45	4.04	3.41
query35	3.35	3.36	3.34
query36	0.56	0.41	0.41
query37	0.10	0.06	0.07
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.16	0.15	0.14
query41	0.08	0.03	0.03
query42	0.03	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 97.92 s
Total hot run time: 24.4 s

@csun5285

Copy link
Copy Markdown
Contributor

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

Changes requested because existing P1 comment 3956640174 still applies to head 7d3d347. No distinct new inline findings were verified; the existing threads are not reposted.

The P1 remains a concrete failure-recovery regression: concurrent RPC workers can share Segment S; after key lookup, another reader can cache a transient column-metadata initialization failure in S. If that failure finishes and the IO fault clears before row-data lookup, the legacy loader detects unhealthy S and opens a replacement, while the new direct path replays S's stored failure. The author's observation about a residual race after the old health check does not invalidate this schedule. Reuse should preserve replacement of an already-unhealthy instance; failure frequency was not measured.

Existing P2 comment 3956640179 also remains applicable: with row_store_columns='k,v1', selecting k,v2 reaches the default-enabled column-store fallback, which still reloads and scans for the retained segment. This is an incomplete optimization in a pre-existing branch; no new mixed-source result corruption was established.

Individual critical checkpoint conclusions:

  1. Goal and proof: healthy full-row-store point reads reuse the exact matched segment and remove the second load_segments call. Added unit assertions cover this behavior; P1/P2 qualify completion of the intended behavior.
  2. Scope and clarity: changes are focused on optional segment output, per-row ownership, a shared row-data helper, and test instrumentation.
  3. Concurrency and locks: separate light-pool RPC workers share cached segments and their lazy metadata state. Request contexts remain local; the existing shared tablet-header lock protects rowset selection, IO remains outside it, and no new lock-order edge was found. Shared unhealthy transitions remain P1.
  4. Lifecycle and memory: the retained shared Segment survives key-cache destruction and eviction. Its acquired Rowset remains owned, and member destruction releases Segment before Rowset; query-error cleanup uses the existing memory tracker. No new cycle or static-initialization dependency was found.
  5. Configuration: no configuration item was added or changed; tests restore the globals they modify.
  6. Compatibility: the legacy row-data overload remains and existing key-lookup callers use the default-null new output. These are internal BE interfaces; RPC/storage formats and libc/dependency usage are unchanged.
  7. Thrift/protobuf: no definitions changed; cross-release field-ID checks are inapplicable.
  8. Parallel paths: full/partial/absent row store, row-cache hit/miss, local/cloud IDs, MoW key probes and rowid-fetch callers were traced. Legacy paths retain loader behavior; partial/column-only fallback remains the known incomplete optimization.
  9. Conditions and errors: segment output is assigned after the winning key passes bitmap checks. Misses and failed lookups do not enter direct row-data access; existing Status propagation and current IOContext are preserved.
  10. Test coverage: new cases cover multiple rowsets/segments, shared segments, noncontiguous cloud IDs, NULL, missing/deleted keys, eviction/lifetime, legacy byte parity, complete output and warm row-cache bypass. Unhealthy-transition replacement and partial-row-store mixed-source coverage remain missing as already requested in the existing threads.
  11. Test results: no golden/.out files changed. Expected row values, nullable output and MySQL text bytes match the test input by static inspection; no test execution is claimed.
  12. Observability: existing point-query timings, cache/row hits and IO statistics remain available. The added SyncPoint callback is test/injection instrumentation and compiles away in ordinary production builds; no additional metric requirement was identified.
  13. Transactions, persistence and failover: no durable metadata, EditLog, publish protocol or failover handling changed. Version selection and delete-bitmap checks precede returning the retained segment as before.
  14. Data writes and crashes: no production data-write behavior changed. Shared ownership protects the selected rowset during compaction/GC; no distinct new leak, deadlock or cleanup failure was found.
  15. FE/BE values: no transmitted variable was added. Existing iterator initialization still receives rowset version/commit_tso and the current request's IOContext.
  16. Performance: healthy full-row-store reads avoid repeated loader/cache traversal and segment scanning. Retention adds one shared pointer per found key; it ends with the executor. P2 remains; no latency or throughput improvement was measured.
  17. Other correctness: physical segment identity is preserved independently of vector position and rowset identity. Visibility/bitmap decisions, JSONB decoding, nullable values, cache bypass and legacy dispatch were checked without a distinct additional defect. No new hub-header include, source-.cpp test inclusion or template-pairing change was introduced.

All seven changed files and assigned upstream/downstream mechanisms were reviewed. No additional user focus was supplied. Three assigned reviewers returned NO_NEW_VALUABLE_FINDINGS; every risk was independently confirmed as already covered or dismissed with evidence. Review converged in one round.

Static inspection only: no builds, unit/regression tests or benchmarks were run. The cloud-ID unit cases use local files and do not prove live remote-cloud integration. There are no unresolved new candidates or unreviewed changed-file areas within this static review scope.

Review converged after 1 round(s).

Existing P0/P1 findings confirmed for this head: #67649 (comment)

@csun5285
csun5285 merged commit 211965d into apache:master Oct 26, 2026
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants