Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opt](Nereids) lock table in ascending order of table IDs #45045

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

morrySnow
Copy link
Contributor

@morrySnow morrySnow commented Dec 5, 2024

What problem does this PR solve?

Problem Summary:

Doris's table locks are fair read-write locks. If two threads acquire read locks on tables in different orders and simultaneously a third thread attempts to acquire a write lock on one of these tables, a deadlock can form between the two threads trying to acquire read locks. This PR changes the lock acquisition order for queries to follow the order of table IDs, ensuring that the lock acquisition order for tables is consistent among different threads.

Release note

Execute table locking operations in ascending order of table IDs

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

@doris-robot
Copy link

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?

@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17561	7475	7280	7280
q2	2046	178	170	170
q3	10781	1064	1168	1064
q4	10582	755	733	733
q5	7583	2699	2691	2691
q6	238	147	145	145
q7	1011	621	628	621
q8	9259	1846	1901	1846
q9	6673	6508	6493	6493
q10	7034	2278	2355	2278
q11	484	270	254	254
q12	419	221	222	221
q13	17772	3070	3022	3022
q14	249	220	224	220
q15	575	535	531	531
q16	647	576	586	576
q17	964	602	512	512
q18	7294	6656	6678	6656
q19	1353	1037	939	939
q20	450	184	179	179
q21	3980	3225	3071	3071
q22	374	317	315	315
Total cold run time: 107329 ms
Total hot run time: 39817 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7265	7264	7257	7257
q2	327	227	227	227
q3	2932	2776	3004	2776
q4	2087	1777	1831	1777
q5	5663	5685	5642	5642
q6	221	139	138	138
q7	2256	1775	1803	1775
q8	3416	3591	3531	3531
q9	8920	9035	8992	8992
q10	3557	3540	3556	3540
q11	609	505	515	505
q12	828	610	601	601
q13	13220	3269	3206	3206
q14	319	271	281	271
q15	579	525	520	520
q16	677	634	636	634
q17	1862	1616	1582	1582
q18	8305	7734	7696	7696
q19	1687	1658	1479	1479
q20	2159	1861	1886	1861
q21	5639	5417	5422	5417
q22	659	624	540	540
Total cold run time: 73187 ms
Total hot run time: 59967 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 68792 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 37a00a223d1b32bccaaecb504588b76bcb9b3bd7, data reload: false

workload_group			0
============================================
show table status;
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
call_center	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:57	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
catalog_page	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
catalog_returns	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:57	2023-12-26 22:46:25	NULL	utf-8	NULL	NULL	
catalog_sales	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:57	2023-12-26 22:55:02	NULL	utf-8	NULL	NULL	
customer	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:44:00	2023-12-26 22:44:53	NULL	utf-8	NULL	NULL	
customer_address	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:44:41	NULL	utf-8	NULL	NULL	
customer_demographics	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:56	2023-12-26 22:44:34	NULL	utf-8	NULL	NULL	
date_dim	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:56	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
dbgen_version	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:44:00	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
household_demographics	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
income_band	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
inventory	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:57	2023-12-26 22:50:32	NULL	utf-8	NULL	NULL	
item	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:44:05	NULL	utf-8	NULL	NULL	
promotion	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
reason	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:56	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
ship_mode	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:44:00	2023-12-26 22:44:05	NULL	utf-8	NULL	NULL	
store	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:59	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
store_returns	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:59	2023-12-26 22:47:09	NULL	utf-8	NULL	NULL	
store_sales	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:59	2023-12-26 22:59:20	NULL	utf-8	NULL	NULL	
time_dim	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:59	2023-12-26 22:44:03	NULL	utf-8	NULL	NULL	
warehouse	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:56	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
web_page	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:59	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
web_returns	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:45:43	NULL	utf-8	NULL	NULL	
web_sales	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:53:25	NULL	utf-8	NULL	NULL	
web_site	Doris	NULL	NULL	0	0	0	NULL	NULL	NULL	NULL	2023-12-26 22:43:58	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
============================================
query1	query2	query3	11028	4628	4217	4217
query4	query5	query6	16066	234	212	212
query7	4109	306	315	306
query8	386	259	250	250
query9	12187	2746	2728	2728
query10	637	286	280	280
query11	query12	227	109	107	107
query13	2089	431	415	415
query14	query15	281	189	182	182
query16	9379	451	484	451
query17	2834	612	586	586
query18	2255	312	326	312
query19	292	154	159	154
query20	120	116	117	116
query21	220	106	112	106
query22	4555	4325	4169	4169
query23	query24	query25	765	405	402	402
query26	1248	155	156	155
query27	5167	283	284	283
query28	6302	2492	2448	2448
query29	997	430	445	430
query30	query31	query32	106	62	62	62
query33	query34	4105	501	496	496
query35	872	757	766	757
query36	1261	945	960	945
query37	126	75	76	75
query38	4331	4281	4260	4260
query39	query40	208	102	105	102
query41	88	48	45	45
query42	125	101	101	101
query43	522	511	488	488
query44	1699	816	791	791
query45	197	180	173	173
query46	1184	717	716	716
query47	query48	435	333	326	326
query49	1531	423	405	405
query50	949	393	365	365
query51	query52	95	87	92	87
query53	267	179	185	179
query54	query55	89	83	82	82
query56	query57	query58	query59	query60	query61	115	115	128	115
query62	899	686	694	686
query63	270	194	198	194
query64	query65	3401	3225	3245	3225
query66	1879	318	312	312
query67	16057	15830	16234	15830
query68	6070	579	570	570
query69	427	275	263	263
query70	1210	1144	1175	1144
query71	342	252	259	252
query72	7899	4401	4242	4242
query73	795	370	394	370
query74	query75	query76	6443	1030	1127	1030
query77	query78	query79	1099	610	608	608
query80	query81	query82	219	129	124	124
query83	query84	233	83	73	73
query85	1105	312	310	310
query86	347	310	313	310
query87	4835	4797	4792	4792
query88	2730	2360	2273	2273
query89	408	299	311	299
query90	1536	187	191	187
query91	332	109	112	109
query92	63	52	50	50
query93	1088	555	548	548
query94	740	296	274	274
query95	query96	618	288	284	284
query97	query98	215	199	204	199
query99	1570	1371	1355	1355
Total cold run time: 162279 ms
Total hot run time: 68792 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.04
query2	0.06	0.04	0.02
query3	0.24	0.07	0.06
query4	1.63	0.11	0.10
query5	0.43	0.42	0.40
query6	1.13	0.64	0.65
query7	0.02	0.02	0.02
query8	0.03	0.03	0.03
query9	0.58	0.51	0.50
query10	0.56	0.56	0.57
query11	0.14	0.10	0.10
query12	0.13	0.12	0.11
query13	0.61	0.60	0.60
query14	2.73	2.82	2.73
query15	0.91	0.83	0.84
query16	0.38	0.38	0.38
query17	0.99	1.03	1.03
query18	0.22	0.21	0.20
query19	1.96	1.81	2.03
query20	0.01	0.01	0.01
query21	15.35	0.60	0.59
query22	2.72	2.69	2.06
query23	17.15	0.93	0.74
query24	3.72	1.64	0.51
query25	0.20	0.18	0.12
query26	0.36	0.14	0.14
query27	0.04	0.03	0.05
query28	10.23	1.08	1.07
query29	12.54	3.21	3.24
query30	0.25	0.07	0.06
query31	2.87	0.38	0.37
query32	3.26	0.46	0.45
query33	2.97	3.16	3.04
query34	16.93	4.47	4.50
query35	4.54	4.45	4.51
query36	0.66	0.48	0.47
query37	0.09	0.06	0.06
query38	0.04	0.03	0.04
query39	0.04	0.03	0.02
query40	0.18	0.13	0.13
query41	0.07	0.03	0.02
query42	0.04	0.02	0.03
query43	0.04	0.02	0.02
Total cold run time: 107.08 s
Total hot run time: 32.24 s

@morrySnow morrySnow force-pushed the lock_table_by_id branch 2 times, most recently from aa00351 to d030993 Compare December 5, 2024 11:13
@morrySnow
Copy link
Contributor Author

run buildall

@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17571	7480	7343	7343
q2	2075	175	171	171
q3	10646	1077	1162	1077
q4	10556	736	684	684
q5	7599	2715	2733	2715
q6	237	149	151	149
q7	1017	638	607	607
q8	9255	1829	1859	1829
q9	6677	6513	6465	6465
q10	6989	2274	2304	2274
q11	471	258	268	258
q12	432	229	223	223
q13	17770	3016	3037	3016
q14	249	214	213	213
q15	576	525	538	525
q16	659	582	584	582
q17	962	538	516	516
q18	7332	6610	6671	6610
q19	1374	1019	923	923
q20	481	181	180	180
q21	4061	3293	3198	3198
q22	378	307	315	307
Total cold run time: 107367 ms
Total hot run time: 39865 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7316	7222	7209	7209
q2	328	235	230	230
q3	2932	2755	2897	2755
q4	2100	1851	1757	1757
q5	5653	5695	5626	5626
q6	229	155	148	148
q7	2228	1778	1794	1778
q8	3394	3580	3491	3491
q9	9065	8972	9031	8972
q10	3621	3535	3558	3535
q11	596	515	492	492
q12	830	618	639	618
q13	11909	3286	3275	3275
q14	308	274	280	274
q15	578	537	520	520
q16	701	660	650	650
q17	1833	1649	1653	1649
q18	8370	7826	7535	7535
q19	1768	1557	1545	1545
q20	2125	1890	1891	1890
q21	5788	5641	5510	5510
q22	663	563	597	563
Total cold run time: 72335 ms
Total hot run time: 60022 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 197793 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 c50ff856672bc5b954909ed2ab0f0581f2d4a77e, data reload: false

query1	1435	946	931	931
query2	6239	2090	2051	2051
query3	10964	4414	4346	4346
query4	66773	29722	23849	23849
query5	4955	486	463	463
query6	419	181	185	181
query7	5677	305	304	304
query8	319	245	235	235
query9	9432	2733	2709	2709
query10	470	257	263	257
query11	17635	15373	15798	15373
query12	156	103	103	103
query13	1570	420	434	420
query14	10257	6929	7521	6929
query15	214	190	195	190
query16	7053	468	444	444
query17	1295	569	588	569
query18	1809	311	295	295
query19	210	159	154	154
query20	117	119	118	118
query21	208	100	96	96
query22	4808	4499	4447	4447
query23	35104	34351	34540	34351
query24	5440	2493	2592	2493
query25	502	389	395	389
query26	640	157	155	155
query27	1768	290	288	288
query28	4467	2496	2464	2464
query29	709	451	406	406
query30	217	153	156	153
query31	1006	859	840	840
query32	66	56	54	54
query33	492	321	301	301
query34	954	538	548	538
query35	858	782	783	782
query36	1090	976	956	956
query37	126	79	77	77
query38	4500	4405	4533	4405
query39	1524	1505	1483	1483
query40	207	103	100	100
query41	45	44	43	43
query42	120	136	100	100
query43	534	495	500	495
query44	1230	832	851	832
query45	187	172	166	166
query46	1194	763	762	762
query47	2003	1922	1897	1897
query48	415	319	323	319
query49	738	405	408	405
query50	822	407	398	398
query51	7428	7259	7130	7130
query52	103	90	91	90
query53	270	182	184	182
query54	521	398	397	397
query55	80	74	82	74
query56	243	238	230	230
query57	1262	1118	1132	1118
query58	218	206	210	206
query59	3233	3102	2962	2962
query60	288	301	268	268
query61	118	104	104	104
query62	803	669	684	669
query63	220	195	190	190
query64	1359	652	627	627
query65	3297	3193	3241	3193
query66	710	301	303	301
query67	15927	15695	15713	15695
query68	4084	565	579	565
query69	426	251	252	251
query70	1193	1148	1126	1126
query71	361	256	241	241
query72	6374	4345	4133	4133
query73	781	363	363	363
query74	9545	9133	9021	9021
query75	3388	2693	2691	2691
query76	1997	1112	1132	1112
query77	491	281	271	271
query78	10315	9511	9398	9398
query79	1435	615	614	614
query80	874	450	434	434
query81	485	240	242	240
query82	1285	124	117	117
query83	234	147	141	141
query84	287	70	71	70
query85	885	302	296	296
query86	342	307	294	294
query87	4645	4545	4614	4545
query88	3582	2235	2199	2199
query89	429	299	285	285
query90	2028	192	183	183
query91	139	102	105	102
query92	63	52	60	52
query93	1962	543	540	540
query94	781	250	283	250
query95	351	250	253	250
query96	610	272	290	272
query97	2847	2723	2679	2679
query98	218	194	196	194
query99	1608	1312	1319	1312
Total cold run time: 319098 ms
Total hot run time: 197793 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.04	0.03
query3	0.24	0.06	0.07
query4	1.65	0.10	0.10
query5	0.43	0.38	0.43
query6	1.15	0.66	0.65
query7	0.02	0.02	0.02
query8	0.04	0.04	0.03
query9	0.57	0.52	0.50
query10	0.57	0.56	0.55
query11	0.14	0.10	0.11
query12	0.14	0.11	0.12
query13	0.63	0.60	0.60
query14	2.83	2.80	2.69
query15	0.90	0.81	0.82
query16	0.38	0.39	0.39
query17	1.02	1.05	1.06
query18	0.21	0.22	0.21
query19	2.00	1.87	1.95
query20	0.02	0.01	0.01
query21	15.36	0.60	0.59
query22	2.54	2.38	2.20
query23	16.86	1.20	0.83
query24	3.45	1.64	2.07
query25	0.32	0.20	0.06
query26	0.53	0.14	0.14
query27	0.05	0.04	0.03
query28	9.25	1.12	1.08
query29	12.56	3.19	3.18
query30	0.25	0.06	0.06
query31	2.89	0.37	0.38
query32	3.29	0.47	0.45
query33	2.99	2.99	3.07
query34	17.11	4.45	4.44
query35	4.48	4.48	4.51
query36	0.67	0.48	0.48
query37	0.08	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.02	0.02
query40	0.18	0.13	0.13
query41	0.09	0.02	0.02
query42	0.04	0.02	0.02
query43	0.04	0.02	0.03
Total cold run time: 106.16 s
Total hot run time: 33.51 s

@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17574	7519	7318	7318
q2	2045	195	168	168
q3	10772	1081	1146	1081
q4	10545	760	726	726
q5	7610	2643	2689	2643
q6	249	151	149	149
q7	992	639	597	597
q8	9254	1865	1868	1865
q9	6754	6477	6474	6474
q10	6993	2319	2281	2281
q11	471	262	251	251
q12	426	222	224	222
q13	17774	3024	3073	3024
q14	236	213	212	212
q15	566	533	528	528
q16	662	602	583	583
q17	968	579	585	579
q18	7288	6670	6586	6586
q19	1345	999	955	955
q20	490	190	179	179
q21	3976	3278	3184	3184
q22	382	322	321	321
Total cold run time: 107372 ms
Total hot run time: 39926 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7343	7255	7296	7255
q2	336	229	235	229
q3	2868	2799	2958	2799
q4	2061	1817	1819	1817
q5	5679	5660	5629	5629
q6	232	142	136	136
q7	2254	1793	1791	1791
q8	3424	3533	3521	3521
q9	8925	9110	9071	9071
q10	3587	3571	3536	3536
q11	590	512	512	512
q12	827	598	586	586
q13	14285	3250	3250	3250
q14	331	268	271	268
q15	573	532	565	532
q16	707	643	616	616
q17	1871	1631	1637	1631
q18	8286	7806	7714	7714
q19	1672	1501	1563	1501
q20	2105	1859	1862	1859
q21	5886	5531	5493	5493
q22	639	569	575	569
Total cold run time: 74481 ms
Total hot run time: 60315 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 196875 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 fd02503b3cfe24462fb1a76a21105747deac3e44, data reload: false

query1	1454	957	931	931
query2	6218	2084	2041	2041
query3	10994	4344	4403	4344
query4	67157	28978	23721	23721
query5	4986	491	455	455
query6	413	204	191	191
query7	5497	316	300	300
query8	324	237	233	233
query9	8903	2718	2678	2678
query10	450	237	242	237
query11	17146	15284	15839	15284
query12	164	100	103	100
query13	1501	420	421	420
query14	10940	7293	7875	7293
query15	208	189	186	186
query16	7024	462	478	462
query17	1285	581	582	581
query18	1542	325	323	323
query19	226	159	170	159
query20	124	114	151	114
query21	212	105	101	101
query22	4858	4601	4432	4432
query23	34675	34423	34632	34423
query24	5480	2419	2417	2417
query25	479	397	373	373
query26	649	154	156	154
query27	1763	288	294	288
query28	4294	2486	2483	2483
query29	689	418	412	412
query30	208	149	150	149
query31	1008	856	869	856
query32	67	55	63	55
query33	445	284	303	284
query34	922	537	529	529
query35	900	770	748	748
query36	1090	972	962	962
query37	122	75	73	73
query38	4660	4358	4427	4358
query39	1541	1479	1477	1477
query40	220	105	110	105
query41	49	47	45	45
query42	117	101	103	101
query43	548	502	504	502
query44	1179	814	828	814
query45	213	166	168	166
query46	1202	733	741	733
query47	2017	1921	1915	1915
query48	408	327	335	327
query49	731	387	390	387
query50	834	389	421	389
query51	7273	7267	7151	7151
query52	97	85	89	85
query53	255	176	175	175
query54	506	407	396	396
query55	83	82	75	75
query56	248	252	231	231
query57	1256	1117	1083	1083
query58	213	217	208	208
query59	3211	2976	2862	2862
query60	271	239	239	239
query61	130	109	111	109
query62	769	680	669	669
query63	212	188	201	188
query64	1338	678	640	640
query65	3271	3238	3206	3206
query66	700	296	301	296
query67	15943	15622	15482	15482
query68	3876	585	568	568
query69	432	259	258	258
query70	1164	1181	1069	1069
query71	361	267	249	249
query72	6342	4014	3884	3884
query73	765	361	370	361
query74	10206	9082	9022	9022
query75	3418	2656	2682	2656
query76	1869	1101	1167	1101
query77	570	272	274	272
query78	10507	9556	9311	9311
query79	1486	609	591	591
query80	861	431	439	431
query81	500	234	226	226
query82	1327	122	110	110
query83	207	146	147	146
query84	275	78	74	74
query85	919	295	309	295
query86	334	305	302	302
query87	4668	4451	4538	4451
query88	3634	2230	2194	2194
query89	424	306	287	287
query90	1983	189	188	188
query91	142	104	105	104
query92	65	48	49	48
query93	1921	546	547	546
query94	766	297	283	283
query95	350	243	248	243
query96	629	278	280	278
query97	2877	2643	2643	2643
query98	228	205	193	193
query99	1596	1318	1285	1285
Total cold run time: 318614 ms
Total hot run time: 196875 ms

@doris-robot
Copy link

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

query1	0.03	0.02	0.03
query2	0.07	0.03	0.03
query3	0.23	0.07	0.07
query4	1.63	0.10	0.11
query5	0.41	0.40	0.41
query6	1.14	0.66	0.67
query7	0.02	0.02	0.02
query8	0.04	0.03	0.03
query9	0.59	0.50	0.52
query10	0.55	0.56	0.56
query11	0.15	0.11	0.10
query12	0.14	0.10	0.11
query13	0.61	0.60	0.61
query14	2.70	2.78	2.73
query15	0.89	0.82	0.83
query16	0.38	0.36	0.39
query17	0.98	1.06	1.05
query18	0.22	0.21	0.20
query19	1.98	1.80	1.91
query20	0.01	0.01	0.01
query21	15.35	0.60	0.58
query22	2.52	2.39	1.66
query23	16.94	0.99	0.87
query24	2.98	1.28	1.14
query25	0.33	0.22	0.18
query26	0.30	0.14	0.13
query27	0.04	0.05	0.04
query28	10.70	1.09	1.07
query29	12.56	3.26	3.23
query30	0.24	0.06	0.05
query31	2.87	0.38	0.37
query32	3.29	0.49	0.45
query33	3.03	2.99	3.00
query34	17.03	4.46	4.45
query35	4.60	4.45	4.48
query36	0.65	0.47	0.48
query37	0.09	0.05	0.06
query38	0.05	0.04	0.04
query39	0.03	0.02	0.03
query40	0.17	0.13	0.12
query41	0.08	0.03	0.02
query42	0.04	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 106.7 s
Total hot run time: 32.59 s

@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17561	7431	7230	7230
q2	2051	176	165	165
q3	10626	1094	1198	1094
q4	10574	768	812	768
q5	7581	2736	2667	2667
q6	239	143	143	143
q7	1022	631	596	596
q8	9235	1826	1932	1826
q9	6731	6497	6475	6475
q10	6981	2291	2312	2291
q11	466	254	261	254
q12	415	218	221	218
q13	17775	3027	3017	3017
q14	236	211	220	211
q15	573	536	528	528
q16	619	579	592	579
q17	963	633	584	584
q18	7232	6784	6717	6717
q19	1335	1014	996	996
q20	471	178	179	178
q21	3991	3155	3216	3155
q22	380	319	307	307
Total cold run time: 107057 ms
Total hot run time: 39999 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7237	7233	7245	7233
q2	341	229	243	229
q3	2898	2781	2972	2781
q4	2050	1791	1767	1767
q5	5668	5669	5651	5651
q6	218	133	139	133
q7	2275	1815	1828	1815
q8	3426	3574	3495	3495
q9	8965	9068	9023	9023
q10	3601	3538	3559	3538
q11	602	502	507	502
q12	820	632	601	601
q13	11988	3217	3168	3168
q14	319	264	272	264
q15	574	523	533	523
q16	672	650	632	632
q17	1849	1629	1582	1582
q18	8352	7764	7989	7764
q19	1704	1647	1544	1544
q20	2176	1901	1914	1901
q21	5711	5503	5428	5428
q22	626	562	550	550
Total cold run time: 72072 ms
Total hot run time: 60124 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 196928 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 47a8e07ef7da1e2ab3759798cbf8dbd7b7c30811, data reload: false

query1	1485	961	941	941
query2	6251	2103	2086	2086
query3	10988	4359	4312	4312
query4	66604	28353	23587	23587
query5	4953	464	479	464
query6	418	191	173	173
query7	5462	309	308	308
query8	334	241	239	239
query9	8520	2718	2705	2705
query10	427	244	257	244
query11	17262	15202	15873	15202
query12	159	105	113	105
query13	1427	421	401	401
query14	10891	6745	6760	6745
query15	232	207	200	200
query16	7141	457	500	457
query17	1067	580	583	580
query18	1705	319	316	316
query19	201	176	160	160
query20	123	125	113	113
query21	208	108	106	106
query22	4669	4513	4387	4387
query23	35020	34436	34796	34436
query24	5500	2447	2488	2447
query25	481	374	378	374
query26	645	150	149	149
query27	1991	280	282	280
query28	4307	2546	2487	2487
query29	687	408	415	408
query30	216	148	146	146
query31	1018	857	902	857
query32	72	55	56	55
query33	449	279	304	279
query34	930	530	512	512
query35	888	765	751	751
query36	1085	960	985	960
query37	126	75	102	75
query38	4458	4493	4444	4444
query39	1534	1537	1468	1468
query40	203	102	104	102
query41	46	43	44	43
query42	110	98	100	98
query43	546	491	503	491
query44	1163	826	818	818
query45	196	174	179	174
query46	1180	737	759	737
query47	2057	1952	1974	1952
query48	421	323	327	323
query49	733	412	417	412
query50	854	393	391	391
query51	7455	7284	7167	7167
query52	100	93	86	86
query53	256	176	176	176
query54	519	390	390	390
query55	76	71	80	71
query56	245	224	233	224
query57	1277	1131	1092	1092
query58	214	209	197	197
query59	3455	3107	3064	3064
query60	279	251	256	251
query61	107	103	102	102
query62	803	695	688	688
query63	206	187	186	186
query64	1399	660	622	622
query65	3260	3186	3209	3186
query66	701	303	305	303
query67	16010	15856	15625	15625
query68	3853	557	580	557
query69	428	251	243	243
query70	1208	1135	1144	1135
query71	342	242	248	242
query72	6430	4035	4084	4035
query73	763	370	364	364
query74	10320	8946	8961	8946
query75	3403	2699	2688	2688
query76	1835	1011	1118	1011
query77	512	270	278	270
query78	10651	9500	9480	9480
query79	1190	600	601	600
query80	788	418	447	418
query81	488	228	224	224
query82	362	118	117	117
query83	167	144	150	144
query84	285	72	71	71
query85	825	289	294	289
query86	340	305	292	292
query87	4750	4600	4624	4600
query88	3280	2224	2195	2195
query89	417	295	307	295
query90	2042	184	185	184
query91	140	102	100	100
query92	65	52	49	49
query93	1099	525	531	525
query94	798	290	288	288
query95	344	239	244	239
query96	618	276	284	276
query97	2832	2691	2625	2625
query98	213	199	192	192
query99	1597	1311	1304	1304
Total cold run time: 316190 ms
Total hot run time: 196928 ms

@doris-robot
Copy link

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

query1	0.03	0.04	0.03
query2	0.07	0.02	0.04
query3	0.24	0.07	0.07
query4	1.62	0.10	0.10
query5	0.42	0.42	0.41
query6	1.17	0.66	0.65
query7	0.03	0.02	0.01
query8	0.04	0.03	0.03
query9	0.56	0.53	0.51
query10	0.57	0.57	0.56
query11	0.15	0.11	0.11
query12	0.14	0.11	0.12
query13	0.60	0.60	0.61
query14	2.85	2.79	2.83
query15	0.90	0.83	0.82
query16	0.39	0.36	0.38
query17	1.04	1.05	1.05
query18	0.22	0.21	0.22
query19	1.88	1.86	2.06
query20	0.01	0.01	0.01
query21	15.36	0.60	0.59
query22	2.62	2.78	2.22
query23	17.15	0.80	0.92
query24	3.15	1.74	1.56
query25	0.21	0.17	0.19
query26	0.44	0.16	0.14
query27	0.05	0.06	0.04
query28	9.45	1.11	1.08
query29	12.55	3.22	3.20
query30	0.25	0.07	0.06
query31	2.86	0.38	0.38
query32	3.30	0.46	0.47
query33	3.00	3.05	3.06
query34	16.69	4.46	4.53
query35	4.54	4.46	4.48
query36	0.66	0.48	0.51
query37	0.09	0.06	0.06
query38	0.05	0.03	0.03
query39	0.04	0.03	0.02
query40	0.16	0.14	0.13
query41	0.07	0.02	0.02
query42	0.03	0.02	0.02
query43	0.03	0.02	0.04
Total cold run time: 105.68 s
Total hot run time: 33.76 s

@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17585	7429	7225	7225
q2	2042	179	177	177
q3	10630	1067	1179	1067
q4	10550	710	725	710
q5	7606	2708	2737	2708
q6	244	146	144	144
q7	1006	629	596	596
q8	9247	1881	1892	1881
q9	6724	6492	6491	6491
q10	6925	2265	2298	2265
q11	461	253	255	253
q12	410	223	211	211
q13	17787	3009	2998	2998
q14	250	210	221	210
q15	569	530	536	530
q16	618	585	572	572
q17	964	554	588	554
q18	7218	6725	6662	6662
q19	1347	957	976	957
q20	473	182	178	178
q21	4119	3262	3139	3139
q22	374	320	314	314
Total cold run time: 107149 ms
Total hot run time: 39842 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7215	7235	7202	7202
q2	324	228	224	224
q3	2910	2754	2930	2754
q4	2125	1848	1839	1839
q5	5660	5643	5600	5600
q6	227	142	140	140
q7	2253	1841	1769	1769
q8	3424	3544	3504	3504
q9	8979	9043	8975	8975
q10	3582	3517	3515	3515
q11	629	502	508	502
q12	806	581	600	581
q13	11343	3234	3173	3173
q14	322	265	277	265
q15	608	538	525	525
q16	701	629	641	629
q17	1844	1634	1627	1627
q18	8275	7900	7521	7521
q19	1722	1564	1593	1564
q20	2120	1854	1900	1854
q21	5566	5514	5445	5445
q22	724	600	571	571
Total cold run time: 71359 ms
Total hot run time: 59779 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 196897 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 888e041db4005ad8b3b4ae26db3ab4e52e3a96b7, data reload: false

query1	1485	977	964	964
query2	6230	2144	2041	2041
query3	10982	4376	4358	4358
query4	66773	29388	23420	23420
query5	4985	459	443	443
query6	403	200	174	174
query7	5648	306	293	293
query8	317	215	217	215
query9	8980	2718	2709	2709
query10	453	230	240	230
query11	17491	15385	15976	15385
query12	161	111	110	110
query13	1514	418	411	411
query14	11352	6749	7087	6749
query15	211	198	202	198
query16	7100	481	462	462
query17	1313	597	580	580
query18	1825	314	309	309
query19	203	161	155	155
query20	121	127	110	110
query21	214	107	106	106
query22	4758	4644	4490	4490
query23	34856	34439	34793	34439
query24	5405	2428	2424	2424
query25	486	388	382	382
query26	662	145	151	145
query27	1810	291	287	287
query28	4564	2494	2472	2472
query29	665	402	400	400
query30	205	151	164	151
query31	1038	835	850	835
query32	62	52	51	51
query33	404	293	286	286
query34	951	503	536	503
query35	904	770	765	765
query36	1109	975	954	954
query37	122	73	76	73
query38	4474	4399	4411	4399
query39	1506	1482	1502	1482
query40	212	104	103	103
query41	50	43	41	41
query42	109	95	100	95
query43	509	506	478	478
query44	1189	816	828	816
query45	190	174	168	168
query46	1202	728	720	720
query47	2013	1938	1953	1938
query48	419	316	324	316
query49	761	405	398	398
query50	872	411	386	386
query51	7367	7165	7093	7093
query52	96	86	87	86
query53	252	187	178	178
query54	502	394	382	382
query55	82	76	77	76
query56	240	238	236	236
query57	1264	1084	1107	1084
query58	217	197	209	197
query59	3316	3187	3362	3187
query60	278	263	241	241
query61	118	103	123	103
query62	812	645	665	645
query63	209	183	185	183
query64	1334	660	621	621
query65	3276	3188	3168	3168
query66	696	289	298	289
query67	15814	15692	15743	15692
query68	4016	567	556	556
query69	428	256	248	248
query70	1183	1144	1091	1091
query71	341	244	245	244
query72	6416	4068	4102	4068
query73	768	366	362	362
query74	10208	8976	9172	8976
query75	3384	2663	2666	2663
query76	2055	1018	1135	1018
query77	471	254	275	254
query78	10581	9537	9559	9537
query79	1733	593	593	593
query80	1232	419	424	419
query81	501	237	222	222
query82	1290	115	118	115
query83	258	140	138	138
query84	279	70	71	70
query85	922	296	290	290
query86	405	295	307	295
query87	4786	4552	4860	4552
query88	3672	2205	2177	2177
query89	416	291	280	280
query90	1944	184	181	181
query91	137	103	101	101
query92	70	49	49	49
query93	1982	540	545	540
query94	812	288	293	288
query95	351	245	286	245
query96	613	276	281	276
query97	2904	2676	2690	2676
query98	227	192	195	192
query99	1572	1301	1310	1301
Total cold run time: 321098 ms
Total hot run time: 196897 ms

@doris-robot
Copy link

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

query1	0.03	0.04	0.03
query2	0.06	0.03	0.04
query3	0.23	0.06	0.07
query4	1.62	0.11	0.11
query5	0.43	0.42	0.40
query6	1.14	0.65	0.64
query7	0.02	0.02	0.01
query8	0.04	0.04	0.02
query9	0.59	0.50	0.52
query10	0.54	0.55	0.56
query11	0.14	0.10	0.10
query12	0.14	0.11	0.11
query13	0.61	0.60	0.60
query14	2.81	2.73	2.75
query15	0.92	0.82	0.83
query16	0.38	0.38	0.36
query17	1.03	1.03	1.00
query18	0.22	0.21	0.21
query19	1.94	1.77	1.92
query20	0.01	0.01	0.01
query21	15.37	0.56	0.58
query22	3.25	2.14	1.43
query23	16.99	0.93	0.82
query24	3.00	1.62	1.06
query25	0.20	0.22	0.08
query26	0.46	0.14	0.13
query27	0.05	0.05	0.04
query28	10.42	1.09	1.07
query29	12.57	3.16	3.21
query30	0.24	0.06	0.06
query31	2.86	0.38	0.38
query32	3.29	0.47	0.46
query33	2.94	3.12	3.05
query34	17.07	4.45	4.42
query35	4.50	4.46	4.48
query36	0.68	0.47	0.48
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.02	0.02
query40	0.16	0.12	0.12
query41	0.07	0.02	0.02
query42	0.03	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 107.25 s
Total hot run time: 32.01 s

morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request Dec 19, 2024
Problem Summary:

Doris's table locks are fair read-write locks. If two threads acquire
read locks on tables in different orders and simultaneously a third
thread attempts to acquire a write lock on one of these tables, a
deadlock can form between the two threads trying to acquire read locks.
This PR changes the lock acquisition order for queries to follow the
order of table IDs, ensuring that the lock acquisition order for tables
is consistent among different threads.

Execute table locking operations in ascending order of table IDs
morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request Dec 19, 2024
pick from master apache#45045

Problem Summary:

Doris's table locks are fair read-write locks. If two threads acquire
read locks on tables in different orders and simultaneously a third
thread attempts to acquire a write lock on one of these tables, a
deadlock can form between the two threads trying to acquire read locks.
This PR changes the lock acquisition order for queries to follow the
order of table IDs, ensuring that the lock acquisition order for tables
is consistent among different threads.

Execute table locking operations in ascending order of table IDs
morrySnow pushed a commit that referenced this pull request Dec 24, 2024
…some test (#45744)

### What problem does this PR solve?

Related PR: #45045

Problem Summary:

if mv2 sql contains mv1 as following, if drop mv_level_1, query mv2
directly would cause err, this fix this

CREATE MATERIALIZED VIEW mv2
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1') 
AS
SELECT * FROM mv_level_1;
github-actions bot pushed a commit that referenced this pull request Dec 24, 2024
…some test (#45744)

### What problem does this PR solve?

Related PR: #45045

Problem Summary:

if mv2 sql contains mv1 as following, if drop mv_level_1, query mv2
directly would cause err, this fix this

CREATE MATERIALIZED VIEW mv2
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1') 
AS
SELECT * FROM mv_level_1;
seawinde added a commit to seawinde/doris that referenced this pull request Dec 24, 2024
…some test (apache#45744)

Related PR: apache#45045

Problem Summary:

if mv2 sql contains mv1 as following, if drop mv_level_1, query mv2
directly would cause err, this fix this

CREATE MATERIALIZED VIEW mv2
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS
SELECT * FROM mv_level_1;
morrySnow added a commit that referenced this pull request Jan 7, 2025
…#46474)

### What problem does this PR solve?

Related PR: #28144 #45045

Problem Summary:
if getTable return Table is not MTMV, ClassCastException raised and lead
to plan failed.
github-actions bot pushed a commit that referenced this pull request Jan 7, 2025
…#46474)

### What problem does this PR solve?

Related PR: #28144 #45045

Problem Summary:
if getTable return Table is not MTMV, ClassCastException raised and lead
to plan failed.
github-actions bot pushed a commit that referenced this pull request Jan 7, 2025
…#46474)

### What problem does this PR solve?

Related PR: #28144 #45045

Problem Summary:
if getTable return Table is not MTMV, ClassCastException raised and lead
to plan failed.
morrySnow added a commit that referenced this pull request Jan 16, 2025
### What problem does this PR solve?

Related PR: #45045

Problem Summary:

we get target table twice, lock them all
morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request Jan 17, 2025
pick from master apache#47033

Related PR: apache#45045

Problem Summary:

we get target table twice, lock them all
github-actions bot pushed a commit that referenced this pull request Jan 17, 2025
### What problem does this PR solve?

Related PR: #45045

Problem Summary:

we get target table twice, lock them all
@yiguolei yiguolei mentioned this pull request Jan 19, 2025
morrySnow added a commit that referenced this pull request Jan 24, 2025
…the original target table (#47337)

### What problem does this PR solve?

Related PR: #47033 #45045

Problem Summary:

because schema change does not involve recreating the table object, but
rather rebuilding the full schema. So, we should use the schema saved
during planning as the schema of the original target table.
github-actions bot pushed a commit that referenced this pull request Jan 24, 2025
…the original target table (#47337)

### What problem does this PR solve?

Related PR: #47033 #45045

Problem Summary:

because schema change does not involve recreating the table object, but
rather rebuilding the full schema. So, we should use the schema saved
during planning as the schema of the original target table.
morrySnow added a commit that referenced this pull request Jan 24, 2025
…the original target table (#47337)

Related PR: #47033 #45045

Problem Summary:

because schema change does not involve recreating the table object, but
rather rebuilding the full schema. So, we should use the schema saved
during planning as the schema of the original target table.
morrySnow added a commit that referenced this pull request Jan 24, 2025
…the original target table (#47337)

Related PR: #47033 #45045

Problem Summary:

because schema change does not involve recreating the table object, but
rather rebuilding the full schema. So, we should use the schema saved
during planning as the schema of the original target table.
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/2.1.8-merged dev/3.0.4-merged p0_b reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants