Skip to content

Conversation

@freemandealer
Copy link
Contributor

originall default capacity is total disk size * ratio we user set zero or extrem large space than acutal disk. I found the ratio part make no sense. we just use total disk size in this case.

I alse add validation for reset_capacity http action rather than set the raw capacity.

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

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

…validation

originall default capacity is total disk size * ratio we user set
zero or extrem large space than acutal disk. I found the ratio part
make no sense. we just use total disk size in this case.

I alse add validation for reset_capacity http action rather than set
the raw capacity.

Signed-off-by: zhengyu <zhangzhengyu@selectdb.com>
@Thearas
Copy link
Contributor

Thearas commented Jun 13, 2025

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?

@freemandealer
Copy link
Contributor Author

run buildall

ss << cache->reset_capacity(new_capacity);
for (auto& [p, cache] : _path_to_cache) {
int64_t valid_capacity;
ss << validate_capacity(p, new_capacity, valid_capacity);
Copy link
Contributor

Choose a reason for hiding this comment

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

if validate_capacity return error like "statfs error", we should not proceed.

Copy link
Contributor

Choose a reason for hiding this comment

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

calling to reset_capacity() should fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not exactly. the operation will never fail. target capacity larger than the max disk capacity will be regulated to max disk capacity.

if (auto iter = _path_to_cache.find(path); iter != _path_to_cache.end()) {
return iter->second->reset_capacity(new_capacity);
int64_t valid_capacity;
ss << validate_capacity(path, new_capacity, valid_capacity);
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

explained above

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17607	5173	4951	4951
q2	1954	317	188	188
q3	10264	1266	769	769
q4	10297	1036	550	550
q5	8732	2356	2347	2347
q6	188	165	137	137
q7	904	773	616	616
q8	9334	1312	1140	1140
q9	6813	5129	5100	5100
q10	6865	2323	1892	1892
q11	488	299	296	296
q12	355	355	227	227
q13	17803	3697	3135	3135
q14	234	230	222	222
q15	566	489	492	489
q16	448	460	391	391
q17	656	855	398	398
q18	7625	7172	7082	7082
q19	1805	971	572	572
q20	367	356	257	257
q21	4239	3504	3142	3142
q22	1063	1038	1001	1001
Total cold run time: 108607 ms
Total hot run time: 34902 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5170	5067	5017	5017
q2	257	333	219	219
q3	2212	2684	2410	2410
q4	1415	1876	1419	1419
q5	4233	4298	4387	4298
q6	223	172	128	128
q7	2063	1971	1789	1789
q8	2611	2634	2530	2530
q9	7326	7293	7225	7225
q10	2926	3164	2794	2794
q11	596	507	500	500
q12	729	794	632	632
q13	3531	3973	3407	3407
q14	283	309	282	282
q15	528	476	470	470
q16	451	507	490	490
q17	1181	1514	1448	1448
q18	7742	7629	7487	7487
q19	867	879	931	879
q20	2093	2057	1926	1926
q21	5003	4405	4572	4405
q22	1121	1080	1060	1060
Total cold run time: 52561 ms
Total hot run time: 50815 ms

@doris-robot
Copy link

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

query1	1410	1028	1034	1028
query2	6186	2051	2086	2051
query3	11009	4467	4598	4467
query4	53352	25616	23221	23221
query5	5080	582	495	495
query6	350	215	210	210
query7	4900	531	319	319
query8	268	241	236	236
query9	5466	2974	3010	2974
query10	487	378	296	296
query11	15819	15091	14929	14929
query12	169	121	117	117
query13	1054	590	456	456
query14	10295	6619	6675	6619
query15	222	214	191	191
query16	7181	669	533	533
query17	1147	778	649	649
query18	1596	440	359	359
query19	235	230	194	194
query20	148	138	127	127
query21	225	132	121	121
query22	4597	4557	4542	4542
query23	34893	33936	33867	33867
query24	6991	2541	2519	2519
query25	486	497	439	439
query26	710	285	165	165
query27	2256	536	386	386
query28	3089	2430	2420	2420
query29	617	609	468	468
query30	281	240	203	203
query31	894	871	789	789
query32	78	72	66	66
query33	455	411	337	337
query34	836	911	574	574
query35	846	867	781	781
query36	1016	1063	971	971
query37	127	108	83	83
query38	4419	4511	4364	4364
query39	1543	1480	1481	1480
query40	224	137	117	117
query41	74	66	61	61
query42	150	127	127	127
query43	556	586	518	518
query44	1463	917	937	917
query45	187	183	171	171
query46	928	1065	691	691
query47	1906	1918	1825	1825
query48	425	467	357	357
query49	636	510	440	440
query50	724	767	449	449
query51	4316	4390	4285	4285
query52	127	124	117	117
query53	247	270	201	201
query54	646	638	577	577
query55	102	94	97	94
query56	328	328	323	323
query57	1245	1241	1242	1241
query58	288	289	290	289
query59	3030	3122	2899	2899
query60	375	353	342	342
query61	138	131	135	131
query62	762	726	676	676
query63	236	208	199	199
query64	1859	1107	734	734
query65	4234	4172	4184	4172
query66	750	407	312	312
query67	16422	15915	15627	15627
query68	7648	980	599	599
query69	567	321	295	295
query70	1301	1230	1221	1221
query71	532	340	347	340
query72	5782	4807	4965	4807
query73	1481	690	398	398
query74	9433	9216	8754	8754
query75	3884	3233	2776	2776
query76	4340	1212	779	779
query77	629	399	316	316
query78	10110	10279	9376	9376
query79	2277	868	645	645
query80	675	544	478	478
query81	485	262	234	234
query82	433	143	105	105
query83	370	275	266	266
query84	303	103	94	94
query85	807	439	346	346
query86	372	340	287	287
query87	4444	4585	4462	4462
query88	3439	2492	2464	2464
query89	423	327	296	296
query90	1961	219	212	212
query91	152	149	121	121
query92	83	65	61	61
query93	1338	1024	655	655
query94	688	411	322	322
query95	387	340	306	306
query96	556	587	312	312
query97	2768	2862	2722	2722
query98	240	227	217	217
query99	1431	1404	1276	1276
Total cold run time: 302450 ms
Total hot run time: 197480 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.08	0.04	0.04
query3	0.24	0.07	0.07
query4	1.60	0.11	0.10
query5	0.46	0.43	0.42
query6	1.18	0.68	0.68
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.60	0.55	0.54
query10	0.58	0.59	0.58
query11	0.16	0.12	0.12
query12	0.16	0.13	0.12
query13	0.62	0.61	0.62
query14	0.82	0.83	0.82
query15	0.92	0.89	0.88
query16	0.40	0.38	0.40
query17	1.12	1.06	1.05
query18	0.24	0.21	0.23
query19	2.00	1.83	1.88
query20	0.02	0.02	0.02
query21	15.40	0.95	0.57
query22	0.78	1.26	0.67
query23	14.82	1.43	0.64
query24	7.33	0.78	0.28
query25	0.28	0.15	0.18
query26	0.60	0.16	0.16
query27	0.06	0.05	0.05
query28	9.18	1.02	0.48
query29	12.62	4.28	3.51
query30	0.25	0.10	0.08
query31	2.82	0.63	0.42
query32	3.24	0.59	0.48
query33	3.26	3.12	3.14
query34	15.73	5.16	4.51
query35	4.57	4.54	4.51
query36	0.67	0.51	0.49
query37	0.10	0.07	0.06
query38	0.06	0.05	0.04
query39	0.04	0.03	0.03
query40	0.17	0.14	0.13
query41	0.08	0.02	0.03
query42	0.04	0.03	0.03
query43	0.05	0.03	0.03
Total cold run time: 103.46 s
Total hot run time: 29.02 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 90.24% (37/41) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.41% (15076/26726)
Line Coverage 45.18% (134826/298425)
Region Coverage 44.30% (67856/153186)
Branch Coverage 38.87% (34833/89606)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 90.24% (37/41) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.89% (21015/26304)
Line Coverage 72.77% (217050/298268)
Region Coverage 71.01% (127928/180160)
Branch Coverage 64.61% (66165/102412)

Signed-off-by: zhengyu <zhangzhengyu@selectdb.com>
@freemandealer
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17579	5215	5013	5013
q2	1927	304	209	209
q3	10270	1306	712	712
q4	10232	1034	533	533
q5	7690	2403	2369	2369
q6	179	162	133	133
q7	891	745	601	601
q8	9312	1340	1105	1105
q9	6852	5142	5115	5115
q10	6878	2405	1956	1956
q11	510	291	281	281
q12	345	347	215	215
q13	17798	3680	3108	3108
q14	232	227	240	227
q15	576	477	482	477
q16	437	431	373	373
q17	593	883	363	363
q18	7748	7301	7162	7162
q19	1343	950	541	541
q20	338	343	225	225
q21	3756	2568	2307	2307
q22	1035	1062	972	972
Total cold run time: 106521 ms
Total hot run time: 33997 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5110	5054	5072	5054
q2	254	328	225	225
q3	2200	2713	2305	2305
q4	1399	1823	1337	1337
q5	4236	4133	4381	4133
q6	215	173	131	131
q7	2021	2007	1706	1706
q8	2581	2601	2537	2537
q9	7157	7132	7235	7132
q10	3062	3259	2831	2831
q11	580	512	497	497
q12	677	751	622	622
q13	3498	3912	3246	3246
q14	283	300	263	263
q15	519	489	468	468
q16	453	470	441	441
q17	1170	1513	1388	1388
q18	7390	7117	7200	7117
q19	768	819	932	819
q20	1929	1982	1841	1841
q21	4754	4430	4280	4280
q22	1060	1043	989	989
Total cold run time: 51316 ms
Total hot run time: 49362 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186359 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 28601cef48a00fa941ea2fc851c3925838974d3b, data reload: false

query1	983	418	383	383
query2	6558	1819	1806	1806
query3	6740	217	221	217
query4	26367	23998	23448	23448
query5	4388	632	464	464
query6	311	213	202	202
query7	4619	501	295	295
query8	274	231	212	212
query9	8615	2639	2644	2639
query10	472	338	275	275
query11	15150	15122	14969	14969
query12	172	113	109	109
query13	1673	547	412	412
query14	9141	6174	6112	6112
query15	203	192	174	174
query16	7294	622	478	478
query17	1170	720	568	568
query18	1976	412	303	303
query19	190	204	158	158
query20	123	115	115	115
query21	216	128	105	105
query22	3953	4083	4033	4033
query23	33866	33033	33146	33033
query24	8494	2343	2362	2343
query25	541	451	393	393
query26	1229	265	149	149
query27	2777	515	347	347
query28	4318	2115	2121	2115
query29	783	544	469	469
query30	284	215	191	191
query31	912	841	753	753
query32	74	62	63	62
query33	565	367	330	330
query34	796	850	535	535
query35	764	808	722	722
query36	937	961	904	904
query37	115	96	80	80
query38	4158	4134	4084	4084
query39	1513	1467	1416	1416
query40	212	117	106	106
query41	92	60	61	60
query42	129	109	108	108
query43	489	485	453	453
query44	1312	826	815	815
query45	190	183	168	168
query46	848	1016	628	628
query47	1762	1785	1715	1715
query48	393	422	328	328
query49	749	491	400	400
query50	632	666	408	408
query51	4082	4108	4081	4081
query52	114	111	103	103
query53	231	255	180	180
query54	570	564	506	506
query55	91	91	85	85
query56	330	347	298	298
query57	1184	1208	1110	1110
query58	262	261	254	254
query59	2457	2657	2522	2522
query60	325	319	322	319
query61	126	121	125	121
query62	803	732	661	661
query63	230	186	187	186
query64	4312	1007	666	666
query65	4319	4176	4170	4170
query66	1151	424	336	336
query67	15740	15602	15721	15602
query68	6975	892	534	534
query69	491	327	280	280
query70	1189	1148	1126	1126
query71	416	402	293	293
query72	5720	4705	4657	4657
query73	634	604	352	352
query74	8853	9126	8839	8839
query75	3153	3175	2721	2721
query76	3198	1179	745	745
query77	485	373	289	289
query78	10030	10180	9388	9388
query79	2303	809	588	588
query80	570	533	437	437
query81	498	266	233	233
query82	182	128	101	101
query83	243	252	232	232
query84	248	103	87	87
query85	752	360	310	310
query86	374	317	280	280
query87	4325	4535	4481	4481
query88	3866	2292	2300	2292
query89	384	313	282	282
query90	1968	214	211	211
query91	144	138	109	109
query92	71	61	66	61
query93	1911	952	570	570
query94	674	424	310	310
query95	367	286	289	286
query96	493	576	283	283
query97	2740	2735	2706	2706
query98	229	208	213	208
query99	1300	1380	1276	1276
Total cold run time: 270635 ms
Total hot run time: 186359 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.07	0.04	0.04
query3	0.24	0.07	0.06
query4	1.61	0.10	0.10
query5	0.44	0.44	0.43
query6	1.16	0.67	0.68
query7	0.02	0.02	0.02
query8	0.04	0.04	0.04
query9	0.58	0.52	0.51
query10	0.56	0.58	0.57
query11	0.15	0.11	0.11
query12	0.16	0.12	0.12
query13	0.63	0.62	0.61
query14	0.82	0.81	0.82
query15	0.91	0.88	0.88
query16	0.41	0.38	0.40
query17	1.12	1.06	1.06
query18	0.23	0.20	0.21
query19	1.95	1.91	1.90
query20	0.01	0.01	0.01
query21	15.39	0.90	0.56
query22	0.73	1.25	0.72
query23	14.81	1.38	0.63
query24	7.31	0.85	0.81
query25	0.49	0.18	0.10
query26	0.69	0.17	0.16
query27	0.05	0.05	0.05
query28	9.32	0.88	0.46
query29	12.55	4.02	3.34
query30	0.25	0.09	0.07
query31	2.82	0.61	0.40
query32	3.23	0.56	0.47
query33	3.07	3.07	3.11
query34	16.26	5.45	4.78
query35	4.83	4.86	4.93
query36	0.70	0.51	0.48
query37	0.09	0.07	0.07
query38	0.05	0.04	0.03
query39	0.03	0.03	0.03
query40	0.17	0.14	0.14
query41	0.08	0.03	0.02
query42	0.04	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 104.15 s
Total hot run time: 29.86 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 81.25% (39/48) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.37% (15057/26712)
Line Coverage 45.15% (134747/298452)
Region Coverage 44.29% (67764/153007)
Branch Coverage 38.89% (34787/89454)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 81.25% (39/48) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 61.23% (16096/26287)
Line Coverage 50.73% (151318/298291)
Region Coverage 48.13% (86623/179994)
Branch Coverage 41.53% (42475/102266)

1 similar comment
@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 81.25% (39/48) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 61.23% (16096/26287)
Line Coverage 50.73% (151318/298291)
Region Coverage 48.13% (86623/179994)
Branch Coverage 41.53% (42475/102266)

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 20, 2025
@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 7622024 into apache:master Jun 23, 2025
27 of 29 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 23, 2025
…validation (#51711)

originall default capacity is total disk size * ratio we user set zero
or extrem large space than acutal disk. I found the ratio part make no
sense. we just use total disk size in this case.

I alse add validation for reset_capacity http action rather than set the
raw capacity.

Signed-off-by: zhengyu <zhangzhengyu@selectdb.com>
dataroaring pushed a commit that referenced this pull request Jun 25, 2025
…et_capacity validation #51711 (#52152)

Cherry-picked from #51711

Signed-off-by: zhengyu <zhangzhengyu@selectdb.com>
Co-authored-by: zhengyu <zhangzhengyu@selectdb.com>
github-actions bot pushed a commit that referenced this pull request Jun 26, 2025
…validation (#51711)

originall default capacity is total disk size * ratio we user set zero
or extrem large space than acutal disk. I found the ratio part make no
sense. we just use total disk size in this case.

I alse add validation for reset_capacity http action rather than set the
raw capacity.

Signed-off-by: zhengyu <zhangzhengyu@selectdb.com>
morrySnow pushed a commit that referenced this pull request Jun 26, 2025
…et_capacity validation #51711 (#52333)

Cherry-picked from #51711

Signed-off-by: zhengyu <zhangzhengyu@selectdb.com>
Co-authored-by: zhengyu <zhangzhengyu@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. cloud dev/3.0.7-merged dev/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants