Skip to content

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented Apr 9, 2024

Proposed changes

  1. Use caffeine instead of guava cache to get better performace

  2. Add a new class CacheFactory

    All (Async)LoadingCache should be built from CacheFactory

  3. Use separator executor for different caches

    1. rowCountRefreshExecutor
      For row count cache.
      Row count cache is an async loading cache, and we can ignore the result
      if cache missing or thread pool is full.
      So use a separate executor for this cache.

    2. commonRefreshExecutor
      For other caches. Other caches are sync loading cache.
      But commonRefreshExecutor will be used for async refresh.
      That is, if cache entry is missing, the cache value will be loaded in caller thread, sychronously.
      if cache entry need refresh, it will be reloaded in commonRefreshExecutor.

    3. fileListingExecutor
      File listing is a heavy operation, so use a separate executor for it.
      For fileCache, the refresh operation will still use commonRefreshExecutor to trigger refresh.
      And fileListingExecutor will be used to list file.

  4. Change the refresh and expire logic of caches

    For most of caches, set refreshAfterWrite strategy, so that
    even if the cache entry is expired, the old entry can still be
    used while new entry is being loaded.

  5. Add new global variable enable_get_row_count_from_file_list

    Default is true, if false, will disable getting row count from file list

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@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

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@morningman morningman marked this pull request as ready for review April 9, 2024 15:41
@morningman
Copy link
Contributor Author

run buildall

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17628	4369	4266	4266
q2	2006	194	181	181
q3	10450	1182	1183	1182
q4	10193	736	719	719
q5	7521	2714	2614	2614
q6	218	132	129	129
q7	1017	608	581	581
q8	9215	2054	2039	2039
q9	7868	6604	6525	6525
q10	8524	3535	3535	3535
q11	461	236	237	236
q12	484	214	213	213
q13	18870	2940	2960	2940
q14	293	230	221	221
q15	535	491	484	484
q16	513	393	375	375
q17	948	689	707	689
q18	7269	6722	6615	6615
q19	7181	1543	1485	1485
q20	689	322	312	312
q21	3583	2792	2867	2792
q22	372	302	304	302
Total cold run time: 115838 ms
Total hot run time: 38435 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4327	4214	4241	4214
q2	368	274	271	271
q3	2978	2773	2744	2744
q4	1851	1579	1574	1574
q5	5357	5360	5303	5303
q6	211	124	127	124
q7	2247	1885	1908	1885
q8	3229	3332	3327	3327
q9	8718	8632	8844	8632
q10	4112	3962	4030	3962
q11	588	514	501	501
q12	824	660	645	645
q13	16022	3260	3178	3178
q14	310	296	276	276
q15	512	475	501	475
q16	518	433	455	433
q17	1834	1563	1541	1541
q18	8101	7983	7906	7906
q19	1743	1579	1561	1561
q20	2108	1960	1985	1960
q21	13559	5323	5177	5177
q22	579	511	498	498
Total cold run time: 80096 ms
Total hot run time: 56187 ms

@doris-robot
Copy link

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

query1	1234	1123	358	358
query2	8529	2947	2586	2586
query3	6767	205	207	205
query4	36908	21477	21424	21424
query5	4117	387	383	383
query6	231	170	175	170
query7	4049	282	276	276
query8	219	162	165	162
query9	5791	2297	2282	2282
query10	370	240	245	240
query11	14746	14258	14252	14252
query12	142	87	93	87
query13	1000	358	348	348
query14	9108	6972	6959	6959
query15	222	180	173	173
query16	7417	252	258	252
query17	1868	560	540	540
query18	1877	273	267	267
query19	270	149	144	144
query20	93	84	87	84
query21	197	123	127	123
query22	4999	4821	4844	4821
query23	33773	33107	33276	33107
query24	11281	3007	3060	3007
query25	592	452	376	376
query26	1321	160	153	153
query27	3107	374	358	358
query28	7622	2061	2056	2056
query29	876	627	614	614
query30	301	172	172	172
query31	985	726	751	726
query32	57	53	53	53
query33	585	253	255	253
query34	962	494	510	494
query35	848	739	724	724
query36	1023	930	928	928
query37	120	72	69	69
query38	3657	3595	3591	3591
query39	1634	1580	1613	1580
query40	172	130	123	123
query41	45	43	42	42
query42	106	97	95	95
query43	579	563	561	561
query44	1329	721	718	718
query45	294	288	269	269
query46	1100	695	715	695
query47	2024	1953	2000	1953
query48	373	296	294	294
query49	888	393	369	369
query50	789	420	414	414
query51	7058	6861	6859	6859
query52	96	84	91	84
query53	341	273	272	272
query54	253	220	215	215
query55	78	69	67	67
query56	232	218	223	218
query57	1197	1135	1114	1114
query58	220	193	200	193
query59	3378	3261	3166	3166
query60	245	220	226	220
query61	91	92	91	91
query62	597	446	431	431
query63	300	274	273	273
query64	4097	3874	4170	3874
query65	3065	3034	3017	3017
query66	741	330	321	321
query67	15584	15261	15049	15049
query68	6611	528	527	527
query69	553	310	306	306
query70	1279	1144	1140	1140
query71	485	268	275	268
query72	6540	2748	2559	2559
query73	843	319	316	316
query74	6779	6415	6377	6377
query75	3170	2366	2276	2276
query76	4134	1099	1145	1099
query77	621	246	250	246
query78	10867	10154	10276	10154
query79	8020	519	515	515
query80	2348	440	442	440
query81	564	242	232	232
query82	1556	94	96	94
query83	328	178	168	168
query84	271	87	84	84
query85	1216	316	310	310
query86	466	303	301	301
query87	3723	3510	3540	3510
query88	5997	2363	2273	2273
query89	536	366	492	366
query90	1933	174	171	171
query91	117	94	93	93
query92	57	45	46	45
query93	6968	502	487	487
query94	1098	182	173	173
query95	1093	1104	1089	1089
query96	596	262	257	257
query97	2666	2454	2436	2436
query98	230	214	215	214
query99	1177	871	864	864
Total cold run time: 307012 ms
Total hot run time: 184784 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.04
query2	0.07	0.04	0.03
query3	0.24	0.05	0.04
query4	1.68	0.06	0.08
query5	0.48	0.49	0.47
query6	1.47	0.65	0.65
query7	0.02	0.01	0.01
query8	0.05	0.04	0.03
query9	0.55	0.50	0.49
query10	0.54	0.55	0.54
query11	0.16	0.11	0.12
query12	0.14	0.12	0.13
query13	0.59	0.58	0.60
query14	0.75	0.78	0.79
query15	0.83	0.81	0.80
query16	0.35	0.35	0.36
query17	0.93	1.00	0.95
query18	0.20	0.26	0.24
query19	1.76	1.67	1.70
query20	0.02	0.01	0.01
query21	15.40	0.64	0.64
query22	4.46	7.65	1.82
query23	18.29	1.41	1.31
query24	1.96	0.24	0.20
query25	0.14	0.08	0.08
query26	0.26	0.16	0.16
query27	0.08	0.08	0.08
query28	13.28	1.00	0.99
query29	12.64	3.21	3.22
query30	0.25	0.06	0.06
query31	2.85	0.37	0.38
query32	3.30	0.46	0.45
query33	2.81	2.83	2.82
query34	17.21	4.42	4.43
query35	4.54	4.51	4.48
query36	0.64	0.45	0.46
query37	0.18	0.14	0.15
query38	0.15	0.14	0.14
query39	0.05	0.03	0.04
query40	0.18	0.13	0.14
query41	0.09	0.05	0.05
query42	0.05	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.72 s
Total hot run time: 30.08 s

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit d25da69df195b2119d526a7c439ab10a46c05cb2 with default session variables
Stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      32 seconds loaded 861443392 Bytes, about 25 MB/s
Insert into select:       13.4 seconds inserted 10000000 Rows, about 746K ops/s

@morningman
Copy link
Contributor Author

run buildall

Jibing-Li
Jibing-Li previously approved these changes Apr 15, 2024
Copy link
Contributor

@Jibing-Li Jibing-Li 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 Apr 15, 2024
@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.

AshinGau
AshinGau previously approved these changes Apr 15, 2024
@morningman morningman dismissed stale reviews from AshinGau and Jibing-Li via 5f070e8 April 15, 2024 16:15
@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Apr 15, 2024
@morningman
Copy link
Contributor Author

run buildall

1 similar comment
@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17617	4293	4234	4234
q2	2005	188	183	183
q3	10450	1189	1197	1189
q4	10192	851	744	744
q5	7510	2680	2638	2638
q6	217	129	128	128
q7	986	600	574	574
q8	9231	2041	2022	2022
q9	7332	6544	6518	6518
q10	8571	3532	3500	3500
q11	459	241	227	227
q12	411	208	219	208
q13	17767	2966	2952	2952
q14	280	224	227	224
q15	527	483	491	483
q16	520	398	372	372
q17	952	663	717	663
q18	7300	6645	6635	6635
q19	7766	1512	1497	1497
q20	687	315	308	308
q21	3459	2720	2833	2720
q22	363	305	304	304
Total cold run time: 114602 ms
Total hot run time: 38323 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4301	4183	4196	4183
q2	359	261	263	261
q3	2991	2798	2710	2710
q4	1900	1573	1581	1573
q5	5278	5309	5288	5288
q6	208	122	120	120
q7	2252	1888	1879	1879
q8	3203	3334	3350	3334
q9	8573	8507	8601	8507
q10	4018	3862	3973	3862
q11	603	501	500	500
q12	805	638	629	629
q13	16045	3260	3181	3181
q14	305	267	283	267
q15	558	488	480	480
q16	510	436	422	422
q17	1829	1553	1469	1469
q18	8168	8063	7868	7868
q19	1652	1606	1555	1555
q20	2030	1855	1832	1832
q21	8709	5058	5063	5058
q22	563	485	479	479
Total cold run time: 74860 ms
Total hot run time: 55457 ms

@doris-robot
Copy link

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

query1	885	377	371	371
query2	6203	2695	2433	2433
query3	6643	211	205	205
query4	23737	21566	21571	21566
query5	4147	397	414	397
query6	269	182	191	182
query7	4581	282	279	279
query8	227	172	173	172
query9	8466	2320	2302	2302
query10	417	246	252	246
query11	14705	14325	14182	14182
query12	127	90	85	85
query13	1640	358	358	358
query14	10031	7553	7036	7036
query15	257	182	186	182
query16	8195	269	253	253
query17	1913	573	550	550
query18	2105	272	261	261
query19	230	143	150	143
query20	89	83	82	82
query21	198	127	121	121
query22	5023	4870	4798	4798
query23	33922	33225	33235	33225
query24	11039	3092	3064	3064
query25	639	402	409	402
query26	1196	165	155	155
query27	2645	378	379	378
query28	6983	2073	2106	2073
query29	894	618	633	618
query30	302	183	180	180
query31	997	758	754	754
query32	99	55	54	54
query33	764	254	259	254
query34	1111	493	488	488
query35	854	708	709	708
query36	1077	935	945	935
query37	140	74	70	70
query38	3462	3295	3274	3274
query39	1627	1608	1570	1570
query40	176	137	128	128
query41	46	45	46	45
query42	104	103	100	100
query43	595	552	574	552
query44	1306	751	744	744
query45	285	272	274	272
query46	1130	753	754	753
query47	2059	1950	1908	1908
query48	383	315	311	311
query49	846	386	384	384
query50	794	407	389	389
query51	6863	6837	6717	6717
query52	97	89	89	89
query53	346	275	271	271
query54	307	236	233	233
query55	82	74	74	74
query56	243	230	229	229
query57	1196	1128	1134	1128
query58	229	204	203	203
query59	3440	3405	3306	3306
query60	265	243	238	238
query61	109	106	100	100
query62	605	457	444	444
query63	302	277	278	277
query64	5247	3965	4071	3965
query65	3072	3004	2995	2995
query66	741	321	323	321
query67	15711	15024	15144	15024
query68	10390	549	545	545
query69	607	310	296	296
query70	1445	1148	1062	1062
query71	521	263	268	263
query72	6985	2589	2450	2450
query73	1602	318	314	314
query74	6891	6522	6418	6418
query75	5004	2595	2653	2595
query76	5897	1064	976	976
query77	627	257	258	257
query78	11060	10180	10185	10180
query79	11756	524	518	518
query80	2540	426	425	425
query81	525	243	236	236
query82	239	94	95	94
query83	215	166	165	165
query84	263	82	80	80
query85	1098	297	252	252
query86	341	307	304	304
query87	3493	3297	3272	3272
query88	5586	2338	2353	2338
query89	504	365	372	365
query90	2402	185	181	181
query91	118	96	93	93
query92	57	46	47	46
query93	7446	500	498	498
query94	1534	185	179	179
query95	401	297	313	297
query96	610	261	265	261
query97	3123	2970	2916	2916
query98	250	216	218	216
query99	1056	865	889	865
Total cold run time: 309004 ms
Total hot run time: 184563 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.09	0.04	0.04
query3	0.23	0.06	0.05
query4	1.67	0.07	0.07
query5	0.51	0.50	0.49
query6	1.48	0.72	0.72
query7	0.02	0.01	0.01
query8	0.05	0.04	0.04
query9	0.55	0.49	0.49
query10	0.55	0.57	0.55
query11	0.14	0.11	0.11
query12	0.14	0.12	0.12
query13	0.61	0.58	0.57
query14	0.76	0.77	0.76
query15	0.82	0.80	0.80
query16	0.36	0.36	0.36
query17	1.04	1.02	1.04
query18	0.19	0.26	0.21
query19	1.88	1.68	1.77
query20	0.02	0.01	0.01
query21	15.40	0.66	0.65
query22	4.36	7.69	1.55
query23	18.29	1.32	1.24
query24	1.60	0.34	0.21
query25	0.13	0.08	0.08
query26	0.27	0.16	0.15
query27	0.08	0.08	0.08
query28	13.38	0.99	0.97
query29	12.65	3.26	3.25
query30	0.26	0.08	0.07
query31	2.83	0.37	0.36
query32	3.30	0.45	0.46
query33	2.80	2.80	2.85
query34	17.12	4.41	4.37
query35	4.43	4.51	4.45
query36	0.66	0.46	0.46
query37	0.18	0.15	0.15
query38	0.15	0.14	0.15
query39	0.04	0.04	0.03
query40	0.16	0.13	0.13
query41	0.09	0.04	0.05
query42	0.04	0.04	0.05
query43	0.04	0.03	0.04
Total cold run time: 109.41 s
Total hot run time: 29.83 s

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit b831f802353d4e71718ec9ddcf5ba8c32af23aec with default session variables
Stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      33 seconds loaded 861443392 Bytes, about 24 MB/s
Insert into select:       14.2 seconds inserted 10000000 Rows, about 704K ops/s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17606	4425	4270	4270
q2	2006	196	185	185
q3	10818	1223	1205	1205
q4	10519	722	863	722
q5	7561	2772	2673	2673
q6	221	134	138	134
q7	967	565	547	547
q8	9327	2125	2098	2098
q9	8110	7317	7284	7284
q10	8901	3520	3510	3510
q11	451	239	235	235
q12	489	233	218	218
q13	18530	2956	2981	2956
q14	273	226	241	226
q15	535	499	473	473
q16	529	420	382	382
q17	975	643	742	643
q18	7308	6889	6794	6794
q19	1633	1537	1448	1448
q20	650	325	310	310
q21	3497	2871	3015	2871
q22	376	321	310	310
Total cold run time: 111282 ms
Total hot run time: 39494 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4308	4192	4233	4192
q2	380	267	266	266
q3	3010	2725	2788	2725
q4	1883	1600	1613	1600
q5	5358	5349	5337	5337
q6	212	125	127	125
q7	1768	1427	1416	1416
q8	3224	3340	3348	3340
q9	9276	9237	9288	9237
q10	3944	3672	3745	3672
q11	585	489	483	483
q12	752	574	615	574
q13	11904	2971	2984	2971
q14	312	269	276	269
q15	508	481	468	468
q16	470	444	422	422
q17	1770	1455	1463	1455
q18	7524	7560	7373	7373
q19	1651	1563	1478	1478
q20	1960	1757	1743	1743
q21	4947	4868	4794	4794
q22	550	459	454	454
Total cold run time: 66296 ms
Total hot run time: 54394 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 183657 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 1e4e28865024f3645b288d80af42787628471b89, data reload: false

query1	910	376	370	370
query2	6508	2492	2389	2389
query3	6643	216	216	216
query4	24831	21648	21306	21306
query5	4157	422	419	419
query6	276	169	175	169
query7	4589	285	282	282
query8	222	175	171	171
query9	8363	2367	2333	2333
query10	572	247	247	247
query11	14780	14183	14157	14157
query12	142	88	88	88
query13	1636	357	369	357
query14	9760	7957	7028	7028
query15	263	185	189	185
query16	8169	260	264	260
query17	1919	605	566	566
query18	2120	288	280	280
query19	295	147	158	147
query20	89	87	84	84
query21	194	123	124	123
query22	4949	4843	4765	4765
query23	33767	33134	33077	33077
query24	12247	2934	3020	2934
query25	643	363	370	363
query26	1797	151	146	146
query27	3110	309	311	309
query28	7733	2023	1985	1985
query29	1019	595	598	595
query30	304	177	173	173
query31	967	718	734	718
query32	91	54	52	52
query33	736	249	250	249
query34	1085	491	468	468
query35	814	702	695	695
query36	1053	904	884	884
query37	274	74	72	72
query38	3508	3198	3171	3171
query39	1572	1519	1511	1511
query40	268	128	126	126
query41	49	44	43	43
query42	101	92	94	92
query43	565	534	530	530
query44	1191	711	712	711
query45	285	262	262	262
query46	1071	744	718	718
query47	1944	1854	1824	1824
query48	359	303	290	290
query49	1176	377	368	368
query50	757	373	380	373
query51	6640	6654	6621	6621
query52	103	89	89	89
query53	349	277	276	276
query54	312	230	223	223
query55	80	71	70	70
query56	274	225	225	225
query57	1178	1112	1098	1098
query58	232	191	212	191
query59	3292	3254	3208	3208
query60	259	234	228	228
query61	89	90	87	87
query62	662	441	447	441
query63	300	282	276	276
query64	6394	3766	3994	3766
query65	3124	3039	3066	3039
query66	1390	342	338	338
query67	15213	14921	14808	14808
query68	5145	546	530	530
query69	473	300	299	299
query70	1213	1108	1181	1108
query71	1393	1266	1266	1266
query72	6360	2613	2432	2432
query73	711	322	321	321
query74	6905	6407	6448	6407
query75	3363	2650	2685	2650
query76	2855	960	930	930
query77	409	264	258	258
query78	11015	10146	10200	10146
query79	3879	515	501	501
query80	1807	423	433	423
query81	525	242	251	242
query82	892	96	101	96
query83	267	170	165	165
query84	273	92	81	81
query85	2114	265	261	261
query86	515	292	301	292
query87	3473	3256	3284	3256
query88	4403	2422	2412	2412
query89	475	359	367	359
query90	2011	182	180	180
query91	129	97	98	97
query92	58	49	47	47
query93	5017	502	492	492
query94	1239	193	181	181
query95	388	315	303	303
query96	598	267	267	267
query97	3094	2934	2948	2934
query98	254	287	217	217
query99	1223	839	846	839
Total cold run time: 292240 ms
Total hot run time: 183657 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.04
query2	0.08	0.04	0.04
query3	0.23	0.06	0.06
query4	1.66	0.10	0.09
query5	0.49	0.50	0.52
query6	1.50	0.71	0.74
query7	0.02	0.01	0.02
query8	0.05	0.04	0.04
query9	0.53	0.50	0.48
query10	0.56	0.55	0.54
query11	0.16	0.11	0.12
query12	0.15	0.12	0.12
query13	0.60	0.60	0.58
query14	0.77	0.76	0.76
query15	0.83	0.79	0.81
query16	0.35	0.35	0.34
query17	1.00	0.96	0.94
query18	0.19	0.26	0.24
query19	1.76	1.68	1.68
query20	0.02	0.01	0.01
query21	15.42	0.65	0.66
query22	4.68	6.53	2.26
query23	18.32	1.35	1.26
query24	2.06	0.21	0.21
query25	0.15	0.09	0.08
query26	0.25	0.16	0.17
query27	0.08	0.08	0.08
query28	13.27	0.98	0.99
query29	12.57	3.29	3.23
query30	0.25	0.06	0.06
query31	2.87	0.38	0.38
query32	3.27	0.45	0.46
query33	2.90	2.86	2.84
query34	17.15	4.42	4.44
query35	4.46	4.48	4.44
query36	0.65	0.46	0.46
query37	0.20	0.16	0.15
query38	0.16	0.15	0.15
query39	0.05	0.03	0.04
query40	0.18	0.14	0.14
query41	0.10	0.05	0.05
query42	0.07	0.05	0.05
query43	0.04	0.03	0.04
Total cold run time: 110.13 s
Total hot run time: 30.63 s

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit 1e4e28865024f3645b288d80af42787628471b89 with default session variables
Stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      32 seconds loaded 861443392 Bytes, about 25 MB/s
Insert into select:       13.9 seconds inserted 10000000 Rows, about 719K ops/s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 16, 2024
@github-actions
Copy link
Contributor

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

@morningman morningman merged commit 3e0d275 into apache:master Apr 17, 2024
morningman added a commit to morningman/doris that referenced this pull request Apr 17, 2024
1. Use `caffeine` instead of `guava cache` to get better performace
2. Add a new class `CacheFactory`

    All (Async)LoadingCache should be built from `CacheFactory`

3. Use separator executor for different caches

    1. rowCountRefreshExecutor
      For row count cache.
      Row count cache is an async loading cache, and we can ignore the result
      if cache missing or thread pool is full.
      So use a separate executor for this cache.

    2.  commonRefreshExecutor
      For other caches. Other caches are sync loading cache.
      But commonRefreshExecutor will be used for async refresh.
      That is, if cache entry is missing, the cache value will be loaded in caller thread, sychronously.
      if cache entry need refresh, it will be reloaded in commonRefreshExecutor.

    3. fileListingExecutor
      File listing is a heavy operation, so use a separate executor for it.
      For fileCache, the refresh operation will still use commonRefreshExecutor to trigger refresh.
      And fileListingExecutor will be used to list file.

4. Change the refresh and expire logic of caches

    For most of caches, set `refreshAfterWrite` strategy, so that
    even if the cache entry is expired, the old entry can still be
    used while new entry is being loaded.

5. Add new global variable `enable_get_row_count_from_file_list`

    Default is true, if false, will disable getting row count from file list
morningman added a commit that referenced this pull request Apr 17, 2024
part of #33449
in branch 2.0, I do a simple fix by using a separate thread pool for row count cache.
So that it won't block with other thread pool
morningman added a commit to morningman/doris that referenced this pull request Apr 19, 2024
morningman added a commit to morningman/doris that referenced this pull request Apr 30, 2024
1. Use `caffeine` instead of `guava cache` to get better performace
2. Add a new class `CacheFactory`

    All (Async)LoadingCache should be built from `CacheFactory`

3. Use separator executor for different caches

    1. rowCountRefreshExecutor
      For row count cache.
      Row count cache is an async loading cache, and we can ignore the result
      if cache missing or thread pool is full.
      So use a separate executor for this cache.

    2.  commonRefreshExecutor
      For other caches. Other caches are sync loading cache.
      But commonRefreshExecutor will be used for async refresh.
      That is, if cache entry is missing, the cache value will be loaded in caller thread, sychronously.
      if cache entry need refresh, it will be reloaded in commonRefreshExecutor.

    3. fileListingExecutor
      File listing is a heavy operation, so use a separate executor for it.
      For fileCache, the refresh operation will still use commonRefreshExecutor to trigger refresh.
      And fileListingExecutor will be used to list file.

4. Change the refresh and expire logic of caches

    For most of caches, set `refreshAfterWrite` strategy, so that
    even if the cache entry is expired, the old entry can still be
    used while new entry is being loaded.

5. Add new global variable `enable_get_row_count_from_file_list`

    Default is true, if false, will disable getting row count from file list
dataroaring pushed a commit that referenced this pull request May 1, 2024
…4.0 (#34371)

* [feature](insert)use optional location and add hive regression test (#33153)

* [feature](iceberg)The new DDL syntax is added to create iceberg partitioned tables (#33338)

support partition by :

```
create table tb1 (c1 string, ts datetime) engine = iceberg partition by (c1, day(ts)) () properties ("a"="b")
```

* [Enhancement](hive-writer) Adjust table sink exchange rebalancer params. (#33397)

Issue Number:  #31442

Change table sink exchange rebalancer params to node level and adjust these params to improve write performance by better balance.

rebalancer params:
```
DEFINE_mInt64(table_sink_partition_write_min_data_processed_rebalance_threshold,
              "26214400"); // 25MB
// Minimum partition data processed to rebalance writers in exchange when partition writing
DEFINE_mInt64(table_sink_partition_write_min_partition_data_processed_rebalance_threshold,
              "15728640"); // 15MB
```

* [feature](profile) add transaction statistics for profile (#33488)

1. commit total time
2. fs operator total time
     rename file count
     rename dir count
     delete dir count
3. add partition total time
    add partition count
4. update partition total time
    update partition count
like:
```
      -  Transaction  Commit  Time:  906ms
          -  FileSystem  Operator  Time:  833ms
              -  Rename  File  Count:  4
              -  Rename  Dir  Count:  0
              -  Delete  Dir  Count:  0
          -  HMS  Add  Partition  Time:  0ms
              -  HMS  Add  Partition  Count:  0
          -  HMS  Update  Partition  Time:  68ms
              -  HMS  Update  Partition  Count:  4
```

* [feature](iceberg) add iceberg transaction implement (#33629)

Issue #31442

add iceberg transaction

* [feature](insert)support default value when create hive table (#33666)

Issue Number: #31442

hive3 support create table with column's default value
if use hive3, we can write default value to table

* [refactor](filesystem)refactor `filesystem` interface (#33361)

1. Remame`list` to `globList` . The path of this `list` needs to have a wildcard character, and the corresponding hdfs interface is `globStatus`, so the modified name is `globList`.
2. If you only need to view files based on paths, you can use the `listFiles` operation.
3. Merge `listLocatedFiles` function into `listFiles` function.

* [opt](meta-cache) refine the meta cache (#33449)

1. Use `caffeine` instead of `guava cache` to get better performace
2. Add a new class `CacheFactory`

    All (Async)LoadingCache should be built from `CacheFactory`

3. Use separator executor for different caches

    1. rowCountRefreshExecutor
      For row count cache.
      Row count cache is an async loading cache, and we can ignore the result
      if cache missing or thread pool is full.
      So use a separate executor for this cache.

    2.  commonRefreshExecutor
      For other caches. Other caches are sync loading cache.
      But commonRefreshExecutor will be used for async refresh.
      That is, if cache entry is missing, the cache value will be loaded in caller thread, sychronously.
      if cache entry need refresh, it will be reloaded in commonRefreshExecutor.

    3. fileListingExecutor
      File listing is a heavy operation, so use a separate executor for it.
      For fileCache, the refresh operation will still use commonRefreshExecutor to trigger refresh.
      And fileListingExecutor will be used to list file.

4. Change the refresh and expire logic of caches

    For most of caches, set `refreshAfterWrite` strategy, so that
    even if the cache entry is expired, the old entry can still be
    used while new entry is being loaded.

5. Add new global variable `enable_get_row_count_from_file_list`

    Default is true, if false, will disable getting row count from file list

* [bugfix](hive)delete write path after hive insert (#33798)

Issue #31442

1. delete file according query id
2. delete write path after insert

* [Enhancement](multi-catalog) Rewrite `S3URI` to remove tricky virtual bucket mechanism and support different uri styles by flags. (#33858)

Many domestic cloud vendors are compatible with the s3 protocol. However, early versions of s3 client will only generate path style http requests (aws/aws-sdk-java-v2#763) when encountering endpoints that do not start with s3, while some cloud vendors only support virtual host style http request.

Therefore, Doris used `forceVirtualHosted` in `S3URI` to convert it into a virtual hosted path and implemented it through path style.
For example:
For s3 uri `s3://my-bucket/data/file.txt`, It will eventually be parsed into:
- virtualBucket: my-bucket
- Bucket: data (bucket must be set, otherwise the s3 client will report an error) Especially this step is particularly tricky because of the limitations of the s3 client.
- Key: file.txt

 The path style mode is used to generate an http request similar to the virtual host by setting the endpoint to virtualBucket + original endpoint, setting the bucket and key.
**However, the bucket and key here are inconsistent with the original concepts of s3, but the aws client happens to be able to generate an http request similar to the virtual host through the path style mode.**

However, after #30799 we have upgrade the aws sdk version from 2.17.257 to 2.20.131. The current aws s3 client can already generate a virtual host by third party by default style of http request. So in #31111 need to set the path style option, let the s3 client use doris' virtual bucket mechanism to continue working.

**Finally, the virtual bucket mechanism is too confusing and tricky, and we no longer need it with the new version of s3 client.**

### Resolution:

Rewrite `S3URI` to remove tricky virtual bucket mechanism and support different uri styles by flags.

This class represents a fully qualified location in S3 for input/output operations expressed as as URI.
 #### For AWS S3, URI common styles:
  - AWS Client Style(Hadoop S3 Style): `s3://my-bucket/path/to/file?versionId=abc123&partNumber=77&partNumber=88`
  - Virtual Host Style: `https://my-bucket.s3.us-west-1.amazonaws.com/resources/doc.txt?versionId=abc123&partNumber=77&partNumber=88`
  - Path Style: `https://s3.us-west-1.amazonaws.com/my-bucket/resources/doc.txt?versionId=abc123&partNumber=77&partNumber=88`
 
  Regarding the above-mentioned common styles, we can use <code>isPathStyle</code> to control whether to use path style
  or virtual host style.
  "Virtual host style" is the currently mainstream and recommended approach to use, so the default value of
  <code>isPathStyle</code> is false.
 
  #### Other Styles:
  - Virtual Host AWS Client (Hadoop S3) Mixed Style:
    `s3://my-bucket.s3.us-west-1.amazonaws.com/resources/doc.txt?versionId=abc123&partNumber=77&partNumber=88`
  - Path AWS Client (Hadoop S3) Mixed Style:
     `s3://s3.us-west-1.amazonaws.com/my-bucket/resources/doc.txt?versionId=abc123&partNumber=77&partNumber=88`
 
  For these two styles, we can use <code>isPathStyle</code> and <code>forceParsingByStandardUri</code>
  to control whether to use.
  Virtual Host AWS Client (Hadoop S3) Mixed Style: <code>isPathStyle = false && forceParsingByStandardUri = true</code>
  Path AWS Client (Hadoop S3) Mixed Style: <code>isPathStyle = true && forceParsingByStandardUri = true</code>
 
  When the incoming location is url encoded, the encoded string will be returned.
  For <code>getKey()</code>, <code>getQueryParams()</code> will return the encoding string

* [improvement](hive)add the `queryid` to the temporary file path (#34278)

`_temp_<table_name>` to `_temp_<queryid>_<table_name>`.
Prevent users from having a table with the name `_temp_<table_name>`.

So as to partition temp dir

* [feature](Cloud) Load index data into index cache when writing data (#34046)

* [Feature](hive-writer) Implements s3 file committer. (#33937)

Issue Number: #31442

[Feature] (hive-writer) Implements s3 file committer. 

S3 committer will start multipart uploading all files on BE side, and then complete multipart upload these files on FE side. If you do not complete multi parts of a file, the file will not be visible. So in this way, the atomicity of a single file can be guaranteed. But it still cannot guarantee the atomicity of multiple files. Because hive committers have best-effort semantics, this shortens the inconsistent time window.

## ChangeList:
- Add `used_by_s3_committer` in `FileWriterOptions` on BE side to start multi-part uploading files, then complete multi-part uploading files on FE side.
- `cosn://`use s3 client on FE side, because it need to complete multi-part uploading files on FE side.
-  Add `Status directoryExists(String dir)` and `Status deleteDirectory` in `FileSystem`.

---------

Co-authored-by: slothever <18522955+wsjz@users.noreply.github.com>
Co-authored-by: wuwenchi <wuwenchihdu@hotmail.com>
Co-authored-by: Qi Chen <kaka11.chen@gmail.com>
Co-authored-by: AlexYue <yj976240184@gmail.com>
mongo360 pushed a commit to mongo360/doris that referenced this pull request Aug 16, 2024
part of apache#33449
in branch 2.0, I do a simple fix by using a separate thread pool for row count cache.
So that it won't block with other thread pool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants