Skip to content

[fix](load) fix quorum success invalid in move-memtable-on-sink load path#60681

Merged
dataroaring merged 1 commit intoapache:masterfrom
sollhui:fix_quorum_sucess
Feb 25, 2026
Merged

[fix](load) fix quorum success invalid in move-memtable-on-sink load path#60681
dataroaring merged 1 commit intoapache:masterfrom
sollhui:fix_quorum_sucess

Conversation

@sollhui
Copy link
Contributor

@sollhui sollhui commented Feb 11, 2026

Description

In VTabletWriterV2, the _quorum_success() function always returns false even when
all streams have finished successfully, making the quorum success write feature effectively
non-functional.

Root Cause

In both _build_tablet_node_mapping() and _incremental_open_streams(),
_tablets_by_node[node].emplace(tablet_id) is guarded by the known_indexes check:

if (known_indexes.contains(index.index_id)) [[likely]] {
    continue;
}
_indexes_from_node[node].emplace_back(tablet);
_tablets_by_node[node].emplace(tablet_id);
known_indexes.insert(index.index_id);

The known_indexes set is shared across all partitions, tablets, and nodes. Once an
index_id is inserted after processing the first tablet's first node, all subsequent
tablets (and all other nodes of the same tablet) with the same index_id skip the
_tablets_by_node update.

For example, with 1 index, 3 tablets [T1, T2, T3], and 3 replicas [N1, N2, N3]:

Only _tablets_by_node[N1] = {T1} gets populated
T1 on N2/N3, and T2/T3 on all nodes are skipped
This causes _quorum_success() to compute finished_tablets_replica incorrectly:

finished_tablets_replica[T1] = 1 (only counted from N1)
finished_tablets_replica[T2] = 0, finished_tablets_replica[T3] = 0
With a quorum requirement of 2 (for 3 replicas), the check always fails.

The known_indexes optimization was intended only for _indexes_from_node (to avoid
sending duplicate schema info per index), but it incorrectly also blocked the
_tablets_by_node population.

Note: vtablet_writer.cpp does NOT have this issue — its _tablets_by_channel is
populated without the known_indexes guard.

Fix

Move _tablets_by_node[node].emplace(tablet_id) before the known_indexes check in
both _build_tablet_node_mapping() and _incremental_open_streams(), so that every
tablet on every node is correctly recorded.

@hello-stephen
Copy link
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?

@sollhui
Copy link
Contributor Author

sollhui commented Feb 11, 2026

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17650	4663	4302	4302
q2	2077	361	248	248
q3	10107	1293	750	750
q4	10192	776	311	311
q5	7494	2209	1900	1900
q6	192	177	145	145
q7	879	742	606	606
q8	9268	1403	1159	1159
q9	4708	4695	4607	4607
q10	6782	1935	1543	1543
q11	438	267	240	240
q12	334	374	226	226
q13	17832	4043	3252	3252
q14	232	234	207	207
q15	870	808	812	808
q16	694	674	644	644
q17	715	850	483	483
q18	6439	5852	5715	5715
q19	1094	1006	634	634
q20	488	491	379	379
q21	2554	1818	1772	1772
q22	328	281	244	244
Total cold run time: 101367 ms
Total hot run time: 30175 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4363	4348	4383	4348
q2	270	325	247	247
q3	2100	2666	2245	2245
q4	1371	1756	1291	1291
q5	4276	4164	4255	4164
q6	222	179	135	135
q7	1860	1779	1703	1703
q8	2474	2725	2472	2472
q9	7622	7525	7463	7463
q10	2850	3136	2646	2646
q11	659	490	430	430
q12	654	753	580	580
q13	3823	4286	3508	3508
q14	321	325	313	313
q15	914	843	787	787
q16	667	702	664	664
q17	1125	1273	1395	1273
q18	8230	8060	8166	8060
q19	886	866	839	839
q20	2099	2205	2077	2077
q21	4948	4575	4420	4420
q22	553	505	425	425
Total cold run time: 52287 ms
Total hot run time: 50090 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.05
query2	0.10	0.05	0.04
query3	0.26	0.08	0.09
query4	1.61	0.11	0.11
query5	0.27	0.24	0.25
query6	1.18	0.67	0.69
query7	0.03	0.02	0.02
query8	0.05	0.04	0.04
query9	0.55	0.52	0.49
query10	0.55	0.55	0.55
query11	0.14	0.09	0.09
query12	0.14	0.11	0.11
query13	0.62	0.62	0.61
query14	1.08	1.09	1.07
query15	0.87	0.86	0.87
query16	0.40	0.40	0.39
query17	1.12	1.15	1.15
query18	0.23	0.21	0.22
query19	2.15	2.02	1.97
query20	0.02	0.01	0.01
query21	15.40	0.26	0.15
query22	5.05	0.05	0.06
query23	15.98	0.28	0.11
query24	1.19	0.25	0.41
query25	0.09	0.09	0.09
query26	0.14	0.14	0.14
query27	0.07	0.06	0.06
query28	3.32	1.15	0.97
query29	12.54	3.98	3.17
query30	0.29	0.14	0.11
query31	2.83	0.67	0.41
query32	3.25	0.61	0.51
query33	3.27	3.44	3.20
query34	16.18	5.39	4.72
query35	4.85	4.81	4.78
query36	0.67	0.51	0.50
query37	0.12	0.07	0.07
query38	0.07	0.05	0.04
query39	0.04	0.03	0.03
query40	0.20	0.17	0.15
query41	0.10	0.03	0.03
query42	0.04	0.04	0.03
query43	0.05	0.04	0.04
Total cold run time: 97.16 s
Total hot run time: 28.36 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/2) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.80% (19487/36906)
Line Coverage 36.27% (181567/500551)
Region Coverage 32.68% (140919/431236)
Branch Coverage 33.69% (61066/181277)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 50.00% (1/2) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.72% (25934/36161)
Line Coverage 54.32% (271233/499312)
Region Coverage 51.74% (225373/435615)
Branch Coverage 53.23% (96863/181981)

@sollhui sollhui changed the title [fix](quorum success) fix quorum success invalid in move-memtable-on-sink load path [fix](load) fix quorum success invalid in move-memtable-on-sink load path Feb 12, 2026
@sollhui
Copy link
Contributor Author

sollhui commented Feb 12, 2026

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17612	4532	4334	4334
q2	2043	365	247	247
q3	10137	1290	749	749
q4	10190	769	305	305
q5	7501	2183	1946	1946
q6	229	175	144	144
q7	887	753	607	607
q8	9273	1418	1141	1141
q9	5004	4635	4730	4635
q10	6855	1958	1564	1564
q11	490	270	253	253
q12	413	377	227	227
q13	17822	4062	3268	3268
q14	242	245	219	219
q15	870	830	799	799
q16	690	675	642	642
q17	710	793	543	543
q18	6678	5986	6406	5986
q19	1660	1047	658	658
q20	554	538	415	415
q21	2810	2004	1958	1958
q22	349	299	259	259
Total cold run time: 103019 ms
Total hot run time: 30899 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4721	4698	4650	4650
q2	269	358	245	245
q3	2394	2885	2415	2415
q4	1419	1882	1531	1531
q5	4898	4448	4929	4448
q6	225	184	136	136
q7	1994	1901	1860	1860
q8	2552	2676	2391	2391
q9	7438	7432	7691	7432
q10	3021	3112	2666	2666
q11	506	440	433	433
q12	662	746	676	676
q13	3842	4190	3236	3236
q14	261	295	276	276
q15	814	788	777	777
q16	642	691	633	633
q17	1106	1249	1289	1249
q18	7563	7460	7463	7460
q19	857	794	784	784
q20	1949	2031	1889	1889
q21	4463	4220	4179	4179
q22	500	460	421	421
Total cold run time: 52096 ms
Total hot run time: 49787 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 28.27 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 4904e66b3205f3cb75dd991bf3db18d6cdd3dca7, data reload: false

query1	0.05	0.05	0.05
query2	0.10	0.05	0.04
query3	0.26	0.08	0.08
query4	1.62	0.12	0.11
query5	0.27	0.26	0.26
query6	1.18	0.66	0.67
query7	0.03	0.03	0.03
query8	0.05	0.04	0.04
query9	0.58	0.50	0.49
query10	0.55	0.56	0.54
query11	0.14	0.10	0.09
query12	0.14	0.10	0.11
query13	0.63	0.62	0.62
query14	1.06	1.07	1.04
query15	0.88	0.86	0.88
query16	0.42	0.39	0.42
query17	1.16	1.15	1.17
query18	0.22	0.21	0.21
query19	2.13	2.04	2.06
query20	0.02	0.02	0.01
query21	15.39	0.27	0.15
query22	4.91	0.06	0.05
query23	15.88	0.27	0.10
query24	1.16	0.53	0.19
query25	0.08	0.06	0.06
query26	0.15	0.13	0.14
query27	0.08	0.07	0.04
query28	3.84	1.16	0.96
query29	12.56	3.95	3.16
query30	0.28	0.14	0.12
query31	2.81	0.64	0.42
query32	3.25	0.61	0.50
query33	3.29	3.24	3.22
query34	16.14	5.48	4.72
query35	4.77	4.77	4.76
query36	0.64	0.51	0.49
query37	0.12	0.07	0.07
query38	0.08	0.05	0.04
query39	0.05	0.03	0.03
query40	0.20	0.16	0.16
query41	0.09	0.04	0.03
query42	0.05	0.04	0.03
query43	0.04	0.04	0.03
Total cold run time: 97.35 s
Total hot run time: 28.27 s

@sollhui
Copy link
Contributor Author

sollhui commented Feb 19, 2026

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
============================================
q1	17659	4575	4299	4299
q2	q3	10662	784	544	544
q4	4684	374	250	250
q5	7546	1199	1020	1020
q6	172	176	147	147
q7	795	843	669	669
q8	9295	1460	1329	1329
q9	4833	4722	4739	4722
q10	6855	1910	1666	1666
q11	454	262	251	251
q12	701	571	480	480
q13	17788	4174	3412	3412
q14	235	238	213	213
q15	925	785	800	785
q16	754	720	688	688
q17	734	845	441	441
q18	5929	5258	5199	5199
q19	1162	984	652	652
q20	517	493	403	403
q21	4627	2040	1589	1589
q22	361	329	278	278
Total cold run time: 96688 ms
Total hot run time: 29037 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4620	4655	4720	4655
q2	q3	1832	2245	1774	1774
q4	876	1182	778	778
q5	4048	4322	4294	4294
q6	186	175	142	142
q7	1746	1671	1602	1602
q8	2536	2768	2585	2585
q9	7462	7379	7295	7295
q10	2609	2897	2454	2454
q11	527	444	417	417
q12	499	575	454	454
q13	4140	4377	3555	3555
q14	294	311	271	271
q15	849	810	957	810
q16	820	764	706	706
q17	1178	1563	1323	1323
q18	7029	6783	6629	6629
q19	969	960	939	939
q20	2127	2215	1995	1995
q21	4007	3545	3431	3431
q22	488	454	413	413
Total cold run time: 48842 ms
Total hot run time: 46522 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 183418 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 4904e66b3205f3cb75dd991bf3db18d6cdd3dca7, data reload: false

query5	5121	640	523	523
query6	324	216	213	213
query7	4218	467	267	267
query8	332	238	226	226
query9	8720	2738	2710	2710
query10	557	369	331	331
query11	16994	17442	17547	17442
query12	237	152	135	135
query13	1326	498	354	354
query14	7503	3341	3078	3078
query14_1	2945	3260	2931	2931
query15	227	204	182	182
query16	1030	490	467	467
query17	1341	773	653	653
query18	3057	490	360	360
query19	225	221	187	187
query20	151	132	136	132
query21	217	145	118	118
query22	5487	4939	4885	4885
query23	17196	16790	16440	16440
query23_1	16687	16585	16607	16585
query24	7012	1643	1234	1234
query24_1	1225	1239	1226	1226
query25	567	501	389	389
query26	1224	258	148	148
query27	2760	471	284	284
query28	4474	1851	1832	1832
query29	810	543	466	466
query30	310	244	214	214
query31	878	722	642	642
query32	86	72	70	70
query33	524	345	277	277
query34	910	911	564	564
query35	641	690	606	606
query36	1089	1111	939	939
query37	134	95	80	80
query38	2958	2959	2858	2858
query39	894	863	838	838
query39_1	834	822	836	822
query40	228	152	134	134
query41	63	61	60	60
query42	104	106	100	100
query43	369	380	350	350
query44	
query45	200	192	182	182
query46	877	992	607	607
query47	2114	2117	2012	2012
query48	315	332	247	247
query49	648	468	395	395
query50	683	272	218	218
query51	4096	4086	4089	4086
query52	107	106	99	99
query53	292	341	286	286
query54	314	269	251	251
query55	93	86	80	80
query56	320	308	311	308
query57	1365	1327	1266	1266
query58	288	275	273	273
query59	2599	2734	2528	2528
query60	329	332	315	315
query61	147	145	141	141
query62	633	583	548	548
query63	322	274	270	270
query64	4886	1258	975	975
query65	
query66	1390	459	352	352
query67	16426	16612	16227	16227
query68	
query69	407	304	288	288
query70	1001	945	979	945
query71	339	308	300	300
query72	2718	2792	2412	2412
query73	543	551	321	321
query74	9993	9949	9756	9756
query75	2839	2737	2461	2461
query76	2293	1038	672	672
query77	387	375	317	317
query78	11240	11439	10673	10673
query79	2960	833	584	584
query80	1825	637	543	543
query81	577	287	258	258
query82	1005	152	116	116
query83	349	275	280	275
query84	257	124	92	92
query85	886	479	416	416
query86	433	301	293	293
query87	3141	3118	3007	3007
query88	3596	2664	2651	2651
query89	433	368	343	343
query90	1999	181	169	169
query91	159	153	133	133
query92	71	77	69	69
query93	1532	858	496	496
query94	640	317	282	282
query95	564	391	314	314
query96	661	523	226	226
query97	2448	2473	2399	2399
query98	238	222	211	211
query99	981	1007	907	907
Total cold run time: 258345 ms
Total hot run time: 183418 ms

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 33.33% (1/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.68% (19539/37092)
Line Coverage 36.24% (182219/502747)
Region Coverage 32.58% (141389/433974)
Branch Coverage 33.62% (61295/182338)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.20% (26607/36349)
Line Coverage 56.38% (282637/501295)
Region Coverage 53.95% (236301/437996)
Branch Coverage 55.56% (101632/182912)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.23% (26621/36351)
Line Coverage 56.41% (282898/501508)
Region Coverage 53.97% (236599/438359)
Branch Coverage 55.63% (101825/183042)

1 similar comment
@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.23% (26621/36351)
Line Coverage 56.41% (282898/501508)
Region Coverage 53.97% (236599/438359)
Branch Coverage 55.63% (101825/183042)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.31% (26649/36351)
Line Coverage 56.46% (283160/501508)
Region Coverage 54.03% (236858/438359)
Branch Coverage 55.67% (101893/183042)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 66.67% (2/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.65% (26045/36351)
Line Coverage 54.29% (272274/501508)
Region Coverage 51.74% (226825/438359)
Branch Coverage 53.12% (97234/183042)

@sollhui
Copy link
Contributor Author

sollhui commented Feb 24, 2026

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
============================================
q1	17600	4492	4311	4311
q2	q3	10658	792	525	525
q4	4683	361	251	251
q5	7552	1177	1031	1031
q6	174	180	147	147
q7	766	835	671	671
q8	9301	1464	1305	1305
q9	4845	4751	4735	4735
q10	6799	1874	1625	1625
q11	452	252	254	252
q12	715	558	465	465
q13	17783	4251	3425	3425
q14	229	229	217	217
q15	957	813	793	793
q16	762	728	666	666
q17	712	845	443	443
q18	5864	5341	5286	5286
q19	1103	981	624	624
q20	495	500	393	393
q21	4551	1836	1376	1376
q22	334	282	250	250
Total cold run time: 96335 ms
Total hot run time: 28791 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4356	4356	4343	4343
q2	q3	1778	2164	1738	1738
q4	830	1169	745	745
q5	4106	4368	4350	4350
q6	174	173	142	142
q7	1745	1638	1494	1494
q8	2480	2694	2541	2541
q9	7555	7572	7439	7439
q10	2694	2882	2468	2468
q11	524	450	424	424
q12	490	592	460	460
q13	3955	4376	3566	3566
q14	280	299	311	299
q15	877	893	827	827
q16	728	767	738	738
q17	1274	1523	1307	1307
q18	7261	6672	6589	6589
q19	897	850	920	850
q20	2103	2168	2069	2069
q21	4030	3472	3532	3472
q22	527	473	440	440
Total cold run time: 48664 ms
Total hot run time: 46301 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 184521 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 4904e66b3205f3cb75dd991bf3db18d6cdd3dca7, data reload: false

query5	4840	648	521	521
query6	324	221	209	209
query7	4211	468	271	271
query8	334	246	245	245
query9	8794	2782	2782	2782
query10	531	398	365	365
query11	16976	16884	16673	16673
query12	196	124	128	124
query13	1264	460	368	368
query14	6580	3285	2978	2978
query14_1	2873	2821	2819	2819
query15	204	192	178	178
query16	1001	467	461	461
query17	1085	726	626	626
query18	2691	452	351	351
query19	213	213	190	190
query20	139	140	129	129
query21	224	151	125	125
query22	5505	5878	5254	5254
query23	17795	17337	17136	17136
query23_1	17097	17131	16966	16966
query24	7101	1624	1234	1234
query24_1	1233	1247	1234	1234
query25	589	458	397	397
query26	1231	253	166	166
query27	2771	475	294	294
query28	4493	1860	1863	1860
query29	810	583	478	478
query30	309	253	204	204
query31	881	722	621	621
query32	78	79	71	71
query33	522	342	287	287
query34	916	902	572	572
query35	636	669	599	599
query36	1091	1111	982	982
query37	137	95	83	83
query38	3007	2906	2878	2878
query39	901	907	842	842
query39_1	872	817	962	817
query40	233	149	143	143
query41	64	60	62	60
query42	105	104	103	103
query43	377	398	363	363
query44	
query45	198	192	180	180
query46	879	987	612	612
query47	2096	2111	2000	2000
query48	317	341	240	240
query49	634	490	381	381
query50	685	272	216	216
query51	4129	4117	4157	4117
query52	110	107	95	95
query53	291	339	283	283
query54	308	269	276	269
query55	89	85	87	85
query56	347	304	305	304
query57	1358	1332	1284	1284
query58	290	271	274	271
query59	2635	2663	2506	2506
query60	355	322	325	322
query61	157	153	152	152
query62	643	589	552	552
query63	304	284	276	276
query64	4898	1283	991	991
query65	
query66	1398	445	351	351
query67	16360	16464	16322	16322
query68	
query69	412	303	282	282
query70	988	966	958	958
query71	350	310	300	300
query72	2812	2657	2417	2417
query73	550	553	324	324
query74	9950	9897	9761	9761
query75	2856	2788	2452	2452
query76	2307	1075	706	706
query77	363	389	317	317
query78	11154	11425	10717	10717
query79	1140	814	603	603
query80	1355	619	562	562
query81	566	280	267	267
query82	1000	149	112	112
query83	342	271	236	236
query84	248	121	100	100
query85	887	472	440	440
query86	445	301	294	294
query87	3134	3123	3028	3028
query88	3557	2683	2669	2669
query89	432	369	345	345
query90	2047	171	181	171
query91	170	157	134	134
query92	73	79	74	74
query93	939	824	507	507
query94	642	330	286	286
query95	581	409	313	313
query96	635	515	233	233
query97	2458	2496	2416	2416
query98	249	217	231	217
query99	1020	1004	877	877
Total cold run time: 254942 ms
Total hot run time: 184521 ms

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 33.33% (1/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.51% (19548/37230)
Line Coverage 36.11% (182275/504755)
Region Coverage 32.46% (141449/435793)
Branch Coverage 33.42% (61318/183473)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 66.67% (2/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.39% (26048/36488)
Line Coverage 54.13% (272546/503515)
Region Coverage 51.39% (226225/440177)
Branch Coverage 52.86% (97358/184177)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.18% (26702/36488)
Line Coverage 56.46% (284296/503515)
Region Coverage 53.93% (237390/440177)
Branch Coverage 55.58% (102360/184177)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.23% (26721/36488)
Line Coverage 56.52% (284587/503515)
Region Coverage 54.00% (237680/440177)
Branch Coverage 55.64% (102478/184177)

Copy link
Contributor

@liaoxin01 liaoxin01 left a comment

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 added the approved Indicates a PR has been approved by one committer. label Feb 25, 2026
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit 0744fe7 into apache:master Feb 25, 2026
30 of 32 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 25, 2026
…path (#60681)

## Description

In `VTabletWriterV2`, the `_quorum_success()` function always returns
`false` even when
all streams have finished successfully, making the quorum success write
feature effectively
non-functional.

## Root Cause

In both `_build_tablet_node_mapping()` and
`_incremental_open_streams()`,
`_tablets_by_node[node].emplace(tablet_id)` is guarded by the
`known_indexes` check:

```cpp
if (known_indexes.contains(index.index_id)) [[likely]] {
    continue;
}
_indexes_from_node[node].emplace_back(tablet);
_tablets_by_node[node].emplace(tablet_id);
known_indexes.insert(index.index_id);
```

The known_indexes set is shared across all partitions, tablets, and
nodes. Once an
index_id is inserted after processing the first tablet's first node, all
subsequent
tablets (and all other nodes of the same tablet) with the same index_id
skip the
_tablets_by_node update.

For example, with 1 index, 3 tablets [T1, T2, T3], and 3 replicas [N1,
N2, N3]:

Only _tablets_by_node[N1] = {T1} gets populated
T1 on N2/N3, and T2/T3 on all nodes are skipped
This causes _quorum_success() to compute finished_tablets_replica
incorrectly:

finished_tablets_replica[T1] = 1 (only counted from N1)
finished_tablets_replica[T2] = 0, finished_tablets_replica[T3] = 0
With a quorum requirement of 2 (for 3 replicas), the check always fails.

The known_indexes optimization was intended only for _indexes_from_node
(to avoid
sending duplicate schema info per index), but it incorrectly also
blocked the
_tablets_by_node population.

Note: vtablet_writer.cpp does NOT have this issue — its
_tablets_by_channel is
populated without the known_indexes guard.

## Fix
Move _tablets_by_node[node].emplace(tablet_id) before the known_indexes
check in
both _build_tablet_node_mapping() and _incremental_open_streams(), so
that every
tablet on every node is correctly recorded.
yiguolei pushed a commit that referenced this pull request Feb 26, 2026
…n-sink load path #60681 (#60820)

Cherry-picked from #60681

Co-authored-by: hui lai <laihui@selectdb.com>
ybtsdst pushed a commit to ybtsdst/doris that referenced this pull request Feb 27, 2026
…n-sink load path apache#60681 (apache#60820)

Cherry-picked from apache#60681

Co-authored-by: hui lai <laihui@selectdb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.4-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants