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

(cloud-merge) Check the cache config size whether is larger than disk_resource_limit_mode_percent #34137

Merged
merged 4 commits into from
Apr 30, 2024

Conversation

Lchangliang
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

2978

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.

@Lchangliang
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -80,10 +80,13 @@ Status FileCacheFactory::create_file_cache(const std::string& cache_base_path,
LOG_ERROR("").tag("file cache path", cache_base_path).tag("error", strerror(errno));
return Status::IOError("{} statfs error {}", cache_base_path, strerror(errno));
}
size_t disk_total_size = static_cast<size_t>(stat.f_blocks) * static_cast<size_t>(stat.f_bsize);
size_t disk_total_size = static_cast<size_t>(static_cast<size_t>(stat.f_blocks) * static_cast<size_t>(stat.f_bsize)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
size_t disk_total_size = static_cast<size_t>(static_cast<size_t>(stat.f_blocks) * static_cast<size_t>(stat.f_bsize)
auto disk_total_size = static_cast<size_t>(static_cast<size_t>(stat.f_blocks) * static_cast<size_t>(stat.f_bsize)

@Lchangliang
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -80,10 +80,15 @@ Status FileCacheFactory::create_file_cache(const std::string& cache_base_path,
LOG_ERROR("").tag("file cache path", cache_base_path).tag("error", strerror(errno));
return Status::IOError("{} statfs error {}", cache_base_path, strerror(errno));
}
size_t disk_total_size = static_cast<size_t>(stat.f_blocks) * static_cast<size_t>(stat.f_bsize);
size_t disk_total_size = static_cast<size_t>(
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
size_t disk_total_size = static_cast<size_t>(
auto disk_total_size = static_cast<size_t>(

@Lchangliang
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.19% (8919/25342)
Line Coverage: 26.98% (73354/271892)
Region Coverage: 26.16% (37899/144892)
Branch Coverage: 22.97% (19296/83996)
Coverage Report: http://coverage.selectdb-in.cc/coverage/1e060355aa388f5d92bf4a69aa62620382568eeb_1e060355aa388f5d92bf4a69aa62620382568eeb/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17615	4294	4256	4256
q2	2019	198	195	195
q3	10448	1151	1128	1128
q4	10190	850	828	828
q5	7521	2722	2586	2586
q6	244	140	138	138
q7	1033	626	603	603
q8	9250	2048	2040	2040
q9	9058	6597	6599	6597
q10	8832	3725	3693	3693
q11	456	236	243	236
q12	442	227	220	220
q13	17768	2967	2941	2941
q14	260	237	229	229
q15	513	473	472	472
q16	528	384	388	384
q17	952	711	690	690
q18	8019	7430	7324	7324
q19	4659	1548	1513	1513
q20	658	312	318	312
q21	5012	4024	4200	4024
q22	348	283	282	282
Total cold run time: 115825 ms
Total hot run time: 40691 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4374	4176	4244	4176
q2	382	278	264	264
q3	2987	2800	2684	2684
q4	1936	1648	1636	1636
q5	5296	5340	5359	5340
q6	208	124	128	124
q7	2278	1885	1856	1856
q8	3190	3395	3367	3367
q9	8629	8621	8894	8621
q10	4100	3863	3904	3863
q11	601	496	505	496
q12	779	688	671	671
q13	16061	3243	3113	3113
q14	324	284	288	284
q15	520	494	491	491
q16	507	453	442	442
q17	1811	1552	1501	1501
q18	8082	8197	7674	7674
q19	1685	1530	1515	1515
q20	2060	1870	1823	1823
q21	5234	5173	4973	4973
q22	549	507	475	475
Total cold run time: 71593 ms
Total hot run time: 55389 ms

@doris-robot
Copy link

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

query1	897	369	360	360
query2	7678	2484	2405	2405
query3	6654	205	210	205
query4	23269	21547	21364	21364
query5	4191	417	429	417
query6	284	190	180	180
query7	4587	302	294	294
query8	247	197	194	194
query9	8439	2384	2351	2351
query10	422	248	246	246
query11	14716	14250	14285	14250
query12	139	94	86	86
query13	1649	357	353	353
query14	9581	6849	6780	6780
query15	234	200	187	187
query16	7929	264	258	258
query17	1926	555	542	542
query18	1987	270	267	267
query19	198	153	151	151
query20	90	87	85	85
query21	196	128	127	127
query22	5014	4813	4817	4813
query23	34252	33455	33337	33337
query24	11596	3104	3000	3000
query25	665	380	383	380
query26	1333	162	159	159
query27	2661	361	377	361
query28	7294	2094	2134	2094
query29	890	623	628	623
query30	270	155	161	155
query31	1005	767	767	767
query32	95	51	56	51
query33	753	266	263	263
query34	1155	499	506	499
query35	866	709	739	709
query36	1140	932	957	932
query37	139	66	67	66
query38	3440	3376	3302	3302
query39	1629	1590	1584	1584
query40	200	127	131	127
query41	40	39	38	38
query42	107	97	98	97
query43	602	565	575	565
query44	1292	761	769	761
query45	274	271	280	271
query46	1113	796	752	752
query47	2017	1934	1955	1934
query48	391	305	318	305
query49	943	414	399	399
query50	794	407	411	407
query51	7021	6997	6856	6856
query52	97	91	93	91
query53	350	288	282	282
query54	319	231	244	231
query55	77	73	72	72
query56	250	236	239	236
query57	1209	1173	1140	1140
query58	227	204	211	204
query59	3529	3235	3271	3235
query60	263	238	244	238
query61	107	105	105	105
query62	592	460	437	437
query63	343	278	283	278
query64	8501	7192	7161	7161
query65	3071	3000	3028	3000
query66	750	338	321	321
query67	15312	15366	14840	14840
query68	5956	545	549	545
query69	541	303	306	303
query70	1214	1101	1161	1101
query71	485	275	275	275
query72	8168	2684	2443	2443
query73	727	323	322	322
query74	6832	6304	6367	6304
query75	3765	2633	2644	2633
query76	4209	969	999	969
query77	634	270	272	270
query78	10984	10246	10067	10067
query79	5170	533	523	523
query80	1912	432	441	432
query81	529	217	221	217
query82	1694	94	93	93
query83	340	172	167	167
query84	270	90	80	80
query85	1484	332	262	262
query86	470	298	315	298
query87	3485	3295	3227	3227
query88	4887	2342	2324	2324
query89	499	370	374	370
query90	1928	182	185	182
query91	136	97	99	97
query92	57	48	47	47
query93	5051	528	527	527
query94	1075	178	184	178
query95	395	299	310	299
query96	589	267	260	260
query97	3172	2958	2932	2932
query98	233	211	219	211
query99	1163	843	847	843
Total cold run time: 297355 ms
Total hot run time: 187381 ms

Copy link
Collaborator

@gavinchou gavinchou left a comment

Choose a reason for hiding this comment

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

Remove unused code.

@Lchangliang
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

if (disk_total_size < file_cache_settings.capacity) {
file_cache_settings = get_file_cache_settings(size_t(disk_total_size * 0.9),
file_cache_settings.max_query_cache_size);
size_t disk_capacity = static_cast<size_t>(
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
size_t disk_capacity = static_cast<size_t>(
auto disk_capacity = static_cast<size_t>(

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.52% (8925/25130)
Line Coverage: 27.15% (73477/270655)
Region Coverage: 26.33% (37952/144115)
Branch Coverage: 23.13% (19335/83598)
Coverage Report: http://coverage.selectdb-in.cc/coverage/449764fd01a0d2c7b50cbd9ec53748c139c516c0_449764fd01a0d2c7b50cbd9ec53748c139c516c0/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17594	4365	4259	4259
q2	2029	186	209	186
q3	10482	1278	1173	1173
q4	10203	816	770	770
q5	7560	2732	2710	2710
q6	225	134	139	134
q7	1045	631	651	631
q8	9224	2141	2080	2080
q9	9290	6799	6791	6791
q10	9045	3966	3826	3826
q11	454	241	251	241
q12	499	231	236	231
q13	17245	3206	3139	3139
q14	283	249	244	244
q15	520	480	492	480
q16	511	433	397	397
q17	991	702	657	657
q18	8239	7963	7603	7603
q19	5388	1574	1543	1543
q20	653	328	317	317
q21	5316	3350	4084	3350
q22	362	285	282	282
Total cold run time: 117158 ms
Total hot run time: 41044 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4553	4353	4412	4353
q2	381	284	273	273
q3	3175	2912	2947	2912
q4	1948	1679	1676	1676
q5	5413	5422	5515	5422
q6	213	124	121	121
q7	2352	1998	1990	1990
q8	3296	3410	3443	3410
q9	8821	8790	8937	8790
q10	4073	3858	3747	3747
q11	579	508	483	483
q12	791	635	615	615
q13	15921	3108	3125	3108
q14	321	288	271	271
q15	525	482	490	482
q16	495	445	442	442
q17	1821	1513	1530	1513
q18	8170	7509	7365	7365
q19	3828	1549	1561	1549
q20	2039	1790	1797	1790
q21	9880	4829	4782	4782
q22	568	499	488	488
Total cold run time: 79163 ms
Total hot run time: 55582 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185957 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 449764fd01a0d2c7b50cbd9ec53748c139c516c0, data reload: false

query1	906	360	342	342
query2	6427	2332	2390	2332
query3	6639	211	206	206
query4	23089	21199	21109	21109
query5	4148	433	431	431
query6	278	184	175	175
query7	4588	287	289	287
query8	247	202	181	181
query9	8524	2343	2323	2323
query10	437	257	273	257
query11	14720	14225	14260	14225
query12	138	87	87	87
query13	1638	369	363	363
query14	10786	6838	7740	6838
query15	233	173	175	173
query16	7981	263	275	263
query17	1697	599	569	569
query18	2072	288	287	287
query19	205	156	162	156
query20	96	92	87	87
query21	193	130	132	130
query22	4986	4852	4843	4843
query23	33961	33173	33120	33120
query24	6531	3003	2981	2981
query25	593	390	397	390
query26	700	160	151	151
query27	1958	319	319	319
query28	3632	2038	2020	2020
query29	879	678	599	599
query30	232	153	154	153
query31	995	724	725	724
query32	91	51	57	51
query33	491	253	245	245
query34	858	496	471	471
query35	767	686	686	686
query36	1024	931	906	906
query37	103	68	66	66
query38	3128	2985	3002	2985
query39	1606	1557	1534	1534
query40	206	129	131	129
query41	45	38	38	38
query42	107	94	97	94
query43	561	535	541	535
query44	1100	738	751	738
query45	274	276	284	276
query46	1049	734	701	701
query47	1915	1872	1858	1858
query48	356	302	291	291
query49	766	402	413	402
query50	777	394	386	386
query51	6828	6879	6841	6841
query52	103	91	89	89
query53	348	287	286	286
query54	268	237	250	237
query55	81	72	73	72
query56	252	227	222	222
query57	1217	1124	1125	1124
query58	217	200	205	200
query59	3299	3248	3261	3248
query60	256	253	254	253
query61	90	88	94	88
query62	571	431	446	431
query63	308	286	283	283
query64	8106	7220	7155	7155
query65	3145	3013	3035	3013
query66	786	337	346	337
query67	15702	15011	14866	14866
query68	7135	536	542	536
query69	544	308	305	305
query70	1157	1144	1124	1124
query71	480	268	277	268
query72	7895	2659	2410	2410
query73	716	327	324	324
query74	6534	6177	6112	6112
query75	3627	2700	2684	2684
query76	3958	1015	1034	1015
query77	584	268	270	268
query78	10960	10155	10261	10155
query79	8526	528	523	523
query80	1238	442	447	442
query81	498	224	227	224
query82	804	97	99	97
query83	213	168	166	166
query84	272	87	85	85
query85	952	276	260	260
query86	450	322	310	310
query87	3300	3074	3066	3066
query88	5154	2332	2328	2328
query89	552	390	385	385
query90	2130	183	189	183
query91	128	133	99	99
query92	63	49	53	49
query93	6569	526	513	513
query94	1071	182	181	181
query95	384	302	302	302
query96	615	264	262	262
query97	3134	2996	2947	2947
query98	230	224	222	222
query99	1236	854	877	854
Total cold run time: 287419 ms
Total hot run time: 185957 ms

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

Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 30, 2024
@dataroaring dataroaring merged commit 696849b into apache:master Apr 30, 2024
25 of 28 checks passed
M1saka2003 pushed a commit to M1saka2003/doris that referenced this pull request May 14, 2024
M1saka2003 pushed a commit to M1saka2003/doris that referenced this pull request May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants