Skip to content

Conversation

@wenzhenghu
Copy link
Contributor

@wenzhenghu wenzhenghu commented Dec 16, 2025

To fully understand the implementation of the PR, please refer to the following link(It is a Chinese document): https://www.notion.so/V3-1-2c31293e1081807ca476dd5c87efb28e

1. PR Function Overview

The core function of this PR is the implementation of File Cache Admission Control.

  • Background: Doris supports using File Cache to accelerate data access for remote storage (e.g., HDFS, S3). However, in certain scenarios (such as large-scale ETL jobs or heavy ad-hoc queries), reading massive amounts of cold data can evict existing hot data from the File Cache. This leads to "cache pollution" and a significant drop in cache hit rates.
  • Goal: Provide a mechanism to decide whether data scanned by a specific query is allowed to enter the File Cache, based on dimensions such as user identity and table information. If admission is denied, the query will read the data directly from remote storage without populating the cache.

2. Implementation Scheme Analysis

The implementation consists of the following key components:

2.1. FE Side: Admission Decision

The primary logic is located in the createScanRangeLocations method of FileQueryScanNode.java.

  • New Configuration: Introduced the Config.enable_file_cache_admission_control switch.
  • New Manager: Introduced FileCacheAdmissionManager (Singleton) to execute the specific admission judgment logic.
  • Decision Flow:
    1. Before generating Scan Ranges, FileQueryScanNode retrieves the current User Identity (userIdentity), Catalog, Database, and Table information.
    2. It calls FileCacheAdmissionManager.getInstance().isAllowed(...) to obtain a boolean result fileCacheAdmission.
    3. It logs the decision result and the time cost in query plan.
|   0:VHIVE_SCAN_NODE(74)                                                                                       |
|      table: test_file_cache_features.tpch1_parquet.lineitem                                                   |
|      inputSplitNum=10, totalFileSize=205792918, scanRanges=10                                                 |
|      partition=1/1                                                                                            |
|      cardinality=1469949, numNodes=1                                                                          |
|      pushdown agg=NONE                                                                                        |
|      file cache request ADMITTED: user_identity:root@%, reason:user table-level whitelist rule, cost:37996 ns |
|      limit: 1 

2.2. FE Side: Decision Propagation

The decision result needs to be propagated from the FileQueryScanNode down to the underlying split assignment logic.

  • SplitAssignment Modification:

    • The constructor of the SplitAssignment class (located in org.apache.doris.datasource) is modified to accept a new boolean fileCacheAdmission parameter.
  • SplitToScanRange Modification:

    • The splitToScanRange method (or its corresponding Lambda expression) is updated to receive the fileCacheAdmission parameter.
    • This method is responsible for setting this value into the Thrift object.

2.3. Communication Protocol: Thrift Definition Update

To pass the FE's decision to the BE, the Thrift definition (likely TFileRangeDesc or TFileScanRangeParams in PlanNodes.thrift) requires a new field.

  • Inferred Change: A new field optional bool file_cache_admission, is added to the TFileRangeDesc struct.

2.4. BE Side: Enforcement

Although the analysis focuses on the FE, the complete loop requires enforcement on the BE side:

  • FileReader: The BE's FileReader (e.g., HdfsFileReader or S3FileReader) checks the file_cache_admission flag in the incoming TFileRangeDesc during initialization or reading.
  • Cache Policy:
    • If file_cache_admission is true (default): It uses the standard FileCachePolicy, where data not found in the cache is written to the Block File Cache after reading.
    • If file_cache_admission is false: It sets the FileCachePolicy to NO_CACHE, skips the cache writing step, reading directly from remote storage. This protects the existing cache from being polluted.

3. Summary

This PR introduces an Admission Control Manager during the FE query planning phase and transparently passes this control signal through the Split Assignment and Scan Range Generation phases. This ultimately guides the BE side's file readers to selectively use the file cache.

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

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@xuchenhao
Copy link
Contributor

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.85% (1752/2194)
Line Coverage 65.75% (30747/46764)
Region Coverage 66.55% (15370/23096)
Branch Coverage 56.86% (8168/14364)

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 55.99% (229/409) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17643	4211	4071	4071
q2	1999	375	234	234
q3	10267	1343	753	753
q4	10341	915	329	329
q5	9129	2189	1993	1993
q6	209	168	142	142
q7	1020	855	708	708
q8	9364	1448	1232	1232
q9	7461	5369	5312	5312
q10	6890	2371	1940	1940
q11	541	322	305	305
q12	716	767	570	570
q13	17812	3658	3041	3041
q14	289	287	282	282
q15	600	523	508	508
q16	692	687	619	619
q17	727	846	497	497
q18	7902	7213	7079	7079
q19	1095	970	615	615
q20	407	363	247	247
q21	4263	3972	3676	3676
q22	1037	1020	963	963
Total cold run time: 110404 ms
Total hot run time: 35116 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4147	4022	4035	4022
q2	315	400	338	338
q3	2161	2693	2296	2296
q4	1328	1785	1324	1324
q5	4473	4973	4657	4657
q6	224	170	132	132
q7	2064	1984	1852	1852
q8	2702	2580	2648	2580
q9	7816	7550	7540	7540
q10	3135	3281	2877	2877
q11	574	523	499	499
q12	671	753	625	625
q13	3638	4168	3312	3312
q14	313	325	289	289
q15	551	505	498	498
q16	649	700	633	633
q17	1207	1665	1468	1468
q18	7858	7741	7489	7489
q19	893	892	911	892
q20	2032	2076	1896	1896
q21	5022	4372	4289	4289
q22	1026	1013	1004	1004
Total cold run time: 52799 ms
Total hot run time: 50512 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 178276 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 613dab599e351a5d89f129bb2435e6940dc39fd2, data reload: false

query5	4448	617	482	482
query6	335	227	220	220
query7	4227	474	289	289
query8	298	251	244	244
query9	8732	2567	2589	2567
query10	496	379	319	319
query11	15182	15100	14551	14551
query12	180	113	112	112
query13	1258	498	406	406
query14	6161	3269	3073	3073
query14_1	2979	2891	2949	2891
query15	216	198	180	180
query16	908	480	453	453
query17	1142	729	607	607
query18	2477	444	352	352
query19	238	241	205	205
query20	122	116	114	114
query21	220	139	113	113
query22	3932	4042	3821	3821
query23	16615	16179	15821	15821
query23_1	16032	16265	16054	16054
query24	7385	1682	1247	1247
query24_1	1255	1249	1255	1249
query25	580	508	459	459
query26	1260	274	173	173
query27	2743	467	308	308
query28	4492	2161	2147	2147
query29	831	575	474	474
query30	308	248	213	213
query31	824	704	631	631
query32	81	74	72	72
query33	543	342	304	304
query34	915	893	557	557
query35	789	797	741	741
query36	916	920	805	805
query37	156	111	82	82
query38	2865	2903	2827	2827
query39	760	730	724	724
query39_1	730	704	705	704
query40	222	142	118	118
query41	65	64	64	64
query42	114	109	109	109
query43	441	438	406	406
query44	1331	751	742	742
query45	196	191	188	188
query46	885	975	629	629
query47	1633	1662	1603	1603
query48	318	339	264	264
query49	629	427	358	358
query50	683	295	229	229
query51	3843	3850	3884	3850
query52	105	112	102	102
query53	329	352	296	296
query54	303	277	255	255
query55	79	77	73	73
query56	313	313	300	300
query57	1127	1124	1072	1072
query58	273	248	238	238
query59	2393	2570	2417	2417
query60	310	316	293	293
query61	201	155	166	155
query62	700	676	623	623
query63	324	297	303	297
query64	4984	1336	1021	1021
query65	3998	3914	3925	3914
query66	1457	445	316	316
query67	15302	15036	14830	14830
query68	8303	1013	735	735
query69	503	349	310	310
query70	1078	1005	1009	1005
query71	368	306	296	296
query72	6027	4962	5004	4962
query73	671	570	319	319
query74	8798	8777	8526	8526
query75	3183	3116	2775	2775
query76	3989	1138	742	742
query77	551	395	285	285
query78	9539	9533	8777	8777
query79	1582	876	611	611
query80	752	663	559	559
query81	522	269	234	234
query82	226	135	110	110
query83	261	253	238	238
query84	260	129	101	101
query85	931	516	474	474
query86	389	301	295	295
query87	3029	3075	2949	2949
query88	3235	2254	2248	2248
query89	465	418	396	396
query90	2195	161	147	147
query91	181	166	146	146
query92	89	65	66	65
query93	1933	908	564	564
query94	468	304	282	282
query95	588	334	314	314
query96	595	472	206	206
query97	2243	2306	2224	2224
query98	220	202	200	200
query99	1284	1286	1194	1194
Total cold run time: 260427 ms
Total hot run time: 178276 ms

@doris-robot
Copy link

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

query1	0.06	0.04	0.04
query2	0.11	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.12	0.11
query5	0.27	0.26	0.25
query6	1.20	0.66	0.63
query7	0.03	0.03	0.02
query8	0.06	0.04	0.04
query9	0.57	0.52	0.50
query10	0.56	0.55	0.54
query11	0.16	0.10	0.12
query12	0.15	0.12	0.11
query13	0.63	0.59	0.60
query14	1.01	0.98	0.98
query15	0.81	0.78	0.78
query16	0.40	0.41	0.41
query17	1.03	1.08	1.05
query18	0.23	0.21	0.22
query19	1.91	1.82	1.76
query20	0.02	0.02	0.01
query21	15.43	0.30	0.13
query22	4.86	0.05	0.04
query23	16.20	0.29	0.10
query24	1.93	0.23	0.31
query25	0.07	0.08	0.06
query26	0.14	0.14	0.13
query27	0.06	0.08	0.05
query28	3.16	1.22	1.02
query29	12.57	3.99	3.24
query30	0.28	0.14	0.12
query31	2.81	0.63	0.39
query32	3.24	0.54	0.45
query33	3.06	3.04	2.98
query34	17.04	5.21	4.59
query35	4.54	4.54	4.53
query36	0.65	0.50	0.49
query37	0.11	0.07	0.06
query38	0.07	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.14	0.14
query41	0.09	0.03	0.02
query42	0.05	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 97.69 s
Total hot run time: 27.17 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 60.00% (3/5) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.44% (18849/35274)
Line Coverage 39.22% (174515/444985)
Region Coverage 33.79% (134875/399127)
Branch Coverage 34.77% (58106/167102)

@xuchenhao
Copy link
Contributor

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.85% (1752/2194)
Line Coverage 65.74% (30742/46764)
Region Coverage 66.51% (15360/23096)
Branch Coverage 56.77% (8155/14364)

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17639	4208	4120	4120
q2	2028	363	241	241
q3	10150	1337	741	741
q4	10212	849	312	312
q5	7503	2097	2014	2014
q6	210	173	135	135
q7	1019	841	704	704
q8	9345	1471	1278	1278
q9	7389	5379	5443	5379
q10	6901	2399	1985	1985
q11	553	330	295	295
q12	720	723	566	566
q13	17796	3657	3003	3003
q14	284	312	277	277
q15	594	522	509	509
q16	687	682	631	631
q17	709	788	580	580
q18	7703	7671	7920	7671
q19	1110	1060	649	649
q20	436	393	256	256
q21	4777	4198	4193	4193
q22	1101	1098	1032	1032
Total cold run time: 108866 ms
Total hot run time: 36571 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4289	4286	4246	4246
q2	370	398	314	314
q3	2334	2880	2445	2445
q4	1380	1924	1374	1374
q5	4572	4616	4563	4563
q6	260	168	121	121
q7	2073	1908	1850	1850
q8	2667	2501	2457	2457
q9	7672	7525	7490	7490
q10	3075	3235	2671	2671
q11	572	500	475	475
q12	625	700	561	561
q13	3229	3648	3040	3040
q14	276	277	255	255
q15	531	488	481	481
q16	627	631	595	595
q17	1106	1327	1325	1325
q18	7187	7248	7139	7139
q19	852	811	843	811
q20	1899	1962	1811	1811
q21	4711	4312	4256	4256
q22	1093	1034	970	970
Total cold run time: 51400 ms
Total hot run time: 49250 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 178175 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 4ef6f8f34b4a8382d15ce2a2c38f2e35b3bc9c3e, data reload: false

query5	4914	591	446	446
query6	322	223	210	210
query7	4211	476	270	270
query8	315	255	257	255
query9	8789	2558	2539	2539
query10	536	386	321	321
query11	15311	14732	14553	14553
query12	173	118	113	113
query13	1260	506	379	379
query14	5977	3006	2768	2768
query14_1	2670	2666	2691	2666
query15	215	194	182	182
query16	839	456	454	454
query17	1145	684	585	585
query18	2479	432	338	338
query19	231	225	201	201
query20	117	115	109	109
query21	222	142	115	115
query22	3964	4106	3974	3974
query23	16789	16231	15798	15798
query23_1	16056	16009	16033	16009
query24	7316	1648	1251	1251
query24_1	1235	1239	1256	1239
query25	540	464	413	413
query26	1260	265	164	164
query27	2772	468	334	334
query28	4456	2148	2123	2123
query29	792	538	447	447
query30	315	245	219	219
query31	815	724	635	635
query32	83	70	74	70
query33	551	347	288	288
query34	918	934	558	558
query35	791	850	721	721
query36	868	917	813	813
query37	135	91	81	81
query38	2838	2803	2813	2803
query39	751	741	793	741
query39_1	700	688	691	688
query40	225	142	121	121
query41	68	64	66	64
query42	107	106	105	105
query43	445	429	404	404
query44	1322	746	740	740
query45	192	192	185	185
query46	883	994	608	608
query47	1668	1702	1635	1635
query48	322	328	253	253
query49	626	422	356	356
query50	671	294	222	222
query51	3828	3975	3826	3826
query52	105	112	101	101
query53	325	359	287	287
query54	280	258	244	244
query55	78	76	69	69
query56	302	298	295	295
query57	1153	1135	1063	1063
query58	276	250	246	246
query59	2412	2460	2427	2427
query60	312	306	289	289
query61	192	196	186	186
query62	721	654	626	626
query63	333	299	303	299
query64	5060	1450	1122	1122
query65	3961	3958	3975	3958
query66	1458	500	324	324
query67	15237	14886	14642	14642
query68	6242	1007	718	718
query69	499	343	314	314
query70	1065	1011	952	952
query71	387	304	280	280
query72	6043	4837	4901	4837
query73	672	568	317	317
query74	8731	8990	8580	8580
query75	3209	3137	2778	2778
query76	3849	1126	732	732
query77	507	400	286	286
query78	9675	9648	8899	8899
query79	1354	863	594	594
query80	726	656	559	559
query81	510	267	229	229
query82	304	129	104	104
query83	265	253	237	237
query84	263	114	110	110
query85	902	502	463	463
query86	314	300	294	294
query87	3023	3031	2998	2998
query88	3245	2275	2260	2260
query89	460	415	405	405
query90	1977	160	157	157
query91	178	165	146	146
query92	72	64	64	64
query93	1133	892	565	565
query94	478	295	301	295
query95	602	411	331	331
query96	586	491	213	213
query97	2316	2327	2230	2230
query98	211	196	185	185
query99	1278	1300	1211	1211
Total cold run time: 257702 ms
Total hot run time: 178175 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.05
query3	0.26	0.08	0.08
query4	1.61	0.11	0.11
query5	0.27	0.24	0.26
query6	1.16	0.65	0.63
query7	0.03	0.03	0.02
query8	0.06	0.04	0.04
query9	0.59	0.51	0.51
query10	0.55	0.55	0.56
query11	0.15	0.12	0.10
query12	0.15	0.11	0.12
query13	0.62	0.60	0.61
query14	0.99	0.98	0.98
query15	0.80	0.80	0.79
query16	0.39	0.41	0.39
query17	0.97	1.01	0.99
query18	0.23	0.22	0.21
query19	1.93	1.75	1.82
query20	0.02	0.02	0.01
query21	15.60	0.29	0.14
query22	4.88	0.05	0.05
query23	15.98	0.28	0.10
query24	0.97	1.82	0.60
query25	0.09	0.08	0.08
query26	0.14	0.14	0.13
query27	0.08	0.06	0.06
query28	5.26	1.21	1.02
query29	12.65	3.97	3.22
query30	0.28	0.14	0.12
query31	2.83	0.61	0.39
query32	3.22	0.55	0.46
query33	2.96	2.99	2.99
query34	16.89	5.15	4.56
query35	4.56	5.14	4.94
query36	0.70	0.56	0.52
query37	0.11	0.06	0.07
query38	0.07	0.03	0.04
query39	0.05	0.03	0.03
query40	0.19	0.16	0.17
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 98.61 s
Total hot run time: 27.96 s

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.57% (1784/2242)
Line Coverage 64.77% (31733/48997)
Region Coverage 65.43% (15782/24120)
Branch Coverage 55.99% (8380/14968)

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17664	4325	4071	4071
q2	2009	357	235	235
q3	10179	1302	719	719
q4	10212	858	306	306
q5	7576	2106	1895	1895
q6	195	170	140	140
q7	946	791	667	667
q8	9291	1380	1091	1091
q9	4900	4696	4536	4536
q10	6732	1794	1396	1396
q11	517	292	280	280
q12	714	736	610	610
q13	17771	3823	3061	3061
q14	290	298	269	269
q15	573	508	505	505
q16	696	681	656	656
q17	671	793	523	523
q18	7196	6571	7101	6571
q19	1184	1071	702	702
q20	423	366	272	272
q21	3207	2675	2492	2492
q22	1156	1054	1071	1054
Total cold run time: 104102 ms
Total hot run time: 32051 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4319	4238	4241	4238
q2	345	378	340	340
q3	2368	2934	2506	2506
q4	1474	2041	1429	1429
q5	4664	4404	4449	4404
q6	221	187	132	132
q7	1946	1885	1798	1798
q8	2646	2397	2377	2377
q9	7195	7296	7195	7195
q10	2474	2706	2164	2164
q11	537	458	441	441
q12	649	694	567	567
q13	3330	3805	3080	3080
q14	267	296	269	269
q15	518	482	481	481
q16	618	659	606	606
q17	1137	1267	1293	1267
q18	7396	7488	7193	7193
q19	822	787	769	769
q20	1887	1962	1805	1805
q21	4459	4189	4167	4167
q22	1062	1027	986	986
Total cold run time: 50334 ms
Total hot run time: 48214 ms

@doris-robot
Copy link

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

query5	4380	600	486	486
query6	332	219	202	202
query7	4214	470	276	276
query8	344	259	243	243
query9	8754	2920	2886	2886
query10	480	402	353	353
query11	15395	14974	14813	14813
query12	173	114	117	114
query13	1274	513	394	394
query14	6242	3056	2816	2816
query14_1	2689	2686	2725	2686
query15	251	191	170	170
query16	984	477	444	444
query17	1082	671	553	553
query18	2448	432	324	324
query19	225	213	194	194
query20	118	114	115	114
query21	217	141	118	118
query22	3942	4223	4281	4223
query23	16084	15725	15458	15458
query23_1	15382	15619	15450	15450
query24	7235	1527	1177	1177
query24_1	1168	1161	1152	1152
query25	534	441	386	386
query26	1236	270	157	157
query27	2762	440	283	283
query28	4536	2138	2135	2135
query29	797	559	410	410
query30	312	241	213	213
query31	812	617	553	553
query32	79	75	76	75
query33	521	340	299	299
query34	879	872	521	521
query35	730	767	659	659
query36	860	905	866	866
query37	135	96	81	81
query38	2708	2703	2638	2638
query39	771	750	740	740
query39_1	714	717	718	717
query40	230	134	119	119
query41	66	64	64	64
query42	104	111	103	103
query43	434	467	401	401
query44	1308	735	739	735
query45	181	183	177	177
query46	826	937	573	573
query47	1481	1482	1360	1360
query48	316	319	253	253
query49	605	424	348	348
query50	602	274	205	205
query51	3735	3749	3767	3749
query52	102	106	96	96
query53	311	323	267	267
query54	281	283	275	275
query55	80	86	81	81
query56	297	319	294	294
query57	1029	1034	979	979
query58	267	270	257	257
query59	2082	2040	2075	2040
query60	346	332	322	322
query61	160	152	157	152
query62	402	361	308	308
query63	295	258	262	258
query64	4998	1292	991	991
query65	3814	3674	3740	3674
query66	1446	420	311	311
query67	15103	15250	15497	15250
query68	2732	1011	736	736
query69	455	370	332	332
query70	1008	922	895	895
query71	322	311	290	290
query72	5786	3515	3548	3515
query73	610	734	311	311
query74	8800	8665	8588	8588
query75	2794	2849	2517	2517
query76	2409	1077	659	659
query77	363	392	315	315
query78	9858	9916	9198	9198
query79	967	904	591	591
query80	1261	586	486	486
query81	549	264	233	233
query82	635	147	108	108
query83	388	260	237	237
query84	252	117	96	96
query85	1032	520	461	461
query86	399	293	268	268
query87	2888	2879	2727	2727
query88	3481	2588	2570	2570
query89	378	348	335	335
query90	1916	175	169	169
query91	169	166	142	142
query92	81	70	70	70
query93	1106	906	534	534
query94	640	322	302	302
query95	590	335	387	335
query96	640	497	230	230
query97	2334	2387	2326	2326
query98	211	199	202	199
query99	620	595	527	527
Total cold run time: 247417 ms
Total hot run time: 174278 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.12	0.08	0.07
query3	0.32	0.08	0.07
query4	1.60	0.09	0.09
query5	0.26	0.24	0.24
query6	1.15	0.65	0.65
query7	0.03	0.03	0.02
query8	0.07	0.06	0.06
query9	0.57	0.50	0.50
query10	0.54	0.54	0.55
query11	0.26	0.13	0.14
query12	0.27	0.14	0.14
query13	0.62	0.62	0.60
query14	0.98	0.98	0.97
query15	0.90	0.80	0.80
query16	0.40	0.38	0.39
query17	1.08	1.06	0.95
query18	0.25	0.22	0.22
query19	1.95	1.78	1.83
query20	0.02	0.01	0.02
query21	15.40	0.27	0.23
query22	4.95	0.10	0.10
query23	15.41	0.39	0.22
query24	2.29	0.49	0.33
query25	0.10	0.10	0.10
query26	0.17	0.16	0.17
query27	0.10	0.10	0.08
query28	3.63	1.13	0.97
query29	12.52	4.03	3.23
query30	0.32	0.13	0.11
query31	2.79	0.68	0.43
query32	3.24	0.62	0.50
query33	3.04	2.97	3.05
query34	16.21	5.05	4.44
query35	4.44	4.47	4.45
query36	0.62	0.50	0.49
query37	0.25	0.08	0.08
query38	0.21	0.06	0.06
query39	0.08	0.05	0.06
query40	0.20	0.17	0.18
query41	0.14	0.06	0.06
query42	0.07	0.05	0.05
query43	0.06	0.06	0.06
Total cold run time: 97.68 s
Total hot run time: 27.6 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 60.00% (3/5) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.97% (18979/35832)
Line Coverage 39.00% (175788/450740)
Region Coverage 33.59% (136174/405344)
Branch Coverage 34.64% (58897/170008)

@xuchenhao
Copy link
Contributor

run buildall

@xuchenhao xuchenhao force-pushed the file_cache_admission_control branch from f48b520 to bc0ef08 Compare January 15, 2026 01:03
@xuchenhao
Copy link
Contributor

run buildall

@xuchenhao
Copy link
Contributor

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.57% (1784/2242)
Line Coverage 64.78% (31740/48997)
Region Coverage 65.44% (15785/24120)
Branch Coverage 56.01% (8384/14968)

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 60.19% (260/432) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17432	4261	4048	4048
q2	2055	361	247	247
q3	10084	1288	711	711
q4	10226	884	306	306
q5	7498	2044	1878	1878
q6	200	172	140	140
q7	927	774	657	657
q8	9279	1326	1140	1140
q9	4913	4505	4603	4505
q10	6742	1787	1393	1393
q11	497	283	277	277
q12	709	764	602	602
q13	17804	3818	3130	3130
q14	292	306	277	277
q15	576	510	509	509
q16	687	699	622	622
q17	649	764	535	535
q18	7160	6349	6885	6349
q19	1255	1048	659	659
q20	447	388	270	270
q21	3251	2656	2529	2529
q22	1085	1067	1056	1056
Total cold run time: 103768 ms
Total hot run time: 31840 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4399	4434	4247	4247
q2	358	398	343	343
q3	2496	2738	2467	2467
q4	1437	1884	1425	1425
q5	4430	4302	4416	4302
q6	210	167	125	125
q7	1994	1896	1775	1775
q8	2585	2485	2419	2419
q9	7296	7097	7279	7097
q10	2506	2810	2222	2222
q11	546	475	461	461
q12	747	783	650	650
q13	3638	4118	3287	3287
q14	277	282	280	280
q15	517	477	484	477
q16	635	661	625	625
q17	1108	1249	1285	1249
q18	7583	7363	7334	7334
q19	847	790	776	776
q20	1884	1932	1814	1814
q21	4497	4244	4039	4039
q22	1047	1032	980	980
Total cold run time: 51037 ms
Total hot run time: 48394 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174775 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 803bf6d8ec2517aaaf610067ab47195b8f276d42, data reload: false

query5	4605	624	498	498
query6	336	228	212	212
query7	4239	467	259	259
query8	335	240	229	229
query9	8729	2884	2848	2848
query10	475	384	347	347
query11	15246	15082	14997	14997
query12	183	117	118	117
query13	1273	480	409	409
query14	6269	3130	2812	2812
query14_1	2736	2733	2714	2714
query15	205	209	184	184
query16	1008	490	486	486
query17	1115	685	586	586
query18	2497	450	349	349
query19	229	244	225	225
query20	125	115	117	115
query21	219	139	138	138
query22	3892	4103	4046	4046
query23	16177	15556	15199	15199
query23_1	15576	15373	15333	15333
query24	7140	1521	1176	1176
query24_1	1168	1164	1174	1164
query25	571	447	404	404
query26	1240	259	150	150
query27	2769	448	270	270
query28	4545	2164	2132	2132
query29	761	536	434	434
query30	309	241	206	206
query31	848	624	558	558
query32	83	75	70	70
query33	536	351	317	317
query34	902	873	546	546
query35	720	780	672	672
query36	884	914	769	769
query37	134	98	84	84
query38	2736	2713	2668	2668
query39	775	759	743	743
query39_1	716	706	709	706
query40	224	145	118	118
query41	69	65	64	64
query42	107	102	98	98
query43	464	462	410	410
query44	1330	735	738	735
query45	190	189	177	177
query46	831	948	592	592
query47	1321	1370	1366	1366
query48	311	325	236	236
query49	609	428	352	352
query50	611	270	198	198
query51	3841	3831	3806	3806
query52	101	111	96	96
query53	293	325	269	269
query54	288	276	260	260
query55	81	78	76	76
query56	322	309	318	309
query57	1017	1012	929	929
query58	272	260	265	260
query59	2108	2186	2177	2177
query60	344	340	321	321
query61	166	164	158	158
query62	404	347	327	327
query63	294	270	263	263
query64	4928	1305	1070	1070
query65	3903	3734	3715	3715
query66	1460	423	327	327
query67	15588	15652	15508	15508
query68	2384	1087	758	758
query69	442	363	329	329
query70	1017	962	949	949
query71	312	311	298	298
query72	5577	3472	3524	3472
query73	603	723	316	316
query74	8684	8773	8555	8555
query75	2744	2829	2466	2466
query76	2278	1054	669	669
query77	364	374	305	305
query78	9903	10098	9253	9253
query79	1212	919	569	569
query80	1554	576	504	504
query81	570	263	233	233
query82	1006	146	111	111
query83	338	253	249	249
query84	253	115	97	97
query85	1207	527	455	455
query86	414	304	291	291
query87	2914	2866	2824	2824
query88	3534	2578	2572	2572
query89	400	355	317	317
query90	1908	174	165	165
query91	173	181	142	142
query92	79	73	70	70
query93	1190	897	524	524
query94	644	336	297	297
query95	585	408	312	312
query96	649	498	224	224
query97	2357	2396	2354	2354
query98	222	202	201	201
query99	580	583	499	499
Total cold run time: 249301 ms
Total hot run time: 174775 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.10	0.05	0.05
query3	0.25	0.08	0.09
query4	1.61	0.12	0.10
query5	0.26	0.25	0.25
query6	1.16	0.67	0.65
query7	0.03	0.02	0.03
query8	0.05	0.04	0.04
query9	0.57	0.52	0.51
query10	0.56	0.54	0.54
query11	0.14	0.10	0.10
query12	0.14	0.11	0.11
query13	0.61	0.59	0.61
query14	0.95	0.94	0.94
query15	0.80	0.78	0.79
query16	0.41	0.42	0.39
query17	1.04	1.04	1.01
query18	0.23	0.22	0.21
query19	1.98	1.89	1.87
query20	0.01	0.02	0.01
query21	15.45	0.25	0.14
query22	5.05	0.05	0.04
query23	16.06	0.28	0.10
query24	1.99	0.58	0.28
query25	0.07	0.07	0.09
query26	0.15	0.13	0.13
query27	0.08	0.08	0.07
query28	4.29	1.07	0.89
query29	12.52	3.98	3.18
query30	0.28	0.14	0.13
query31	2.82	0.66	0.40
query32	3.25	0.56	0.46
query33	3.02	3.03	3.02
query34	16.04	5.12	4.42
query35	4.43	4.77	5.20
query36	0.70	0.56	0.60
query37	0.12	0.07	0.06
query38	0.08	0.04	0.03
query39	0.04	0.03	0.03
query40	0.19	0.15	0.15
query41	0.09	0.03	0.02
query42	0.04	0.04	0.04
query43	0.05	0.03	0.04
Total cold run time: 97.77 s
Total hot run time: 27.32 s

@xuchenhao
Copy link
Contributor

run buildall

}
}

public static class ConcurrentRuleManager {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ConcurrentRuleManager 这个是否也直接改成 RuleManager

List<AdmissionRule> allRules = new ArrayList<>();

for (File jsonFile : jsonFiles) {
List<AdmissionRule> loadedRules = RuleLoader.loadRulesFromFile(jsonFile.getPath());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

如果出现重复的rule,会如何处理,行为是确定的吗?

return this.scanParams;
}

protected boolean fileCacheAdmissionCheck() throws UserException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

存算分离场景的内表scan是走filequeryscannode吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

哪些类型catalog的scan会走filequeryscannode?

protected FileSplitter fileSplitter;

private static final Set<String> CACHEABLE_CATALOGS = new HashSet<>(
Arrays.asList("hms", "iceberg", "paimon", "lakesoul")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

如何判断是这几种可以启用filecache?

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.57% (1784/2242)
Line Coverage 64.75% (31726/48997)
Region Coverage 65.42% (15780/24120)
Branch Coverage 56.01% (8383/14968)

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	16491	4206	4053	4053
q2	2041	347	239	239
q3	9697	1255	718	718
q4	9749	779	309	309
q5	7305	2099	1825	1825
q6	187	168	134	134
q7	900	795	653	653
q8	9059	1435	1203	1203
q9	4917	4578	4634	4578
q10	6726	1781	1384	1384
q11	525	283	283	283
q12	697	745	614	614
q13	17402	3865	3080	3080
q14	303	286	275	275
q15	574	518	505	505
q16	667	699	619	619
q17	647	827	487	487
q18	6653	6427	6471	6427
q19	1119	1159	649	649
q20	470	420	282	282
q21	3306	2611	2466	2466
q22	1120	1114	1045	1045
Total cold run time: 100555 ms
Total hot run time: 31828 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4338	4250	4388	4250
q2	322	388	338	338
q3	2239	2798	2392	2392
q4	1449	1852	1446	1446
q5	4563	4364	4393	4364
q6	212	166	127	127
q7	1974	1966	1838	1838
q8	2584	2434	2519	2434
q9	7108	7318	7178	7178
q10	2460	2656	2324	2324
q11	547	478	457	457
q12	675	744	592	592
q13	3744	4186	3141	3141
q14	266	280	271	271
q15	527	478	474	474
q16	620	657	622	622
q17	1095	1391	1363	1363
q18	7565	7243	7421	7243
q19	809	806	783	783
q20	1855	1922	1793	1793
q21	4522	4215	4124	4124
q22	1032	1040	971	971
Total cold run time: 50506 ms
Total hot run time: 48525 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174466 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 68e5c36a89862a81d3eb20b9c692ac75651c42d8, data reload: false

query5	4427	618	464	464
query6	314	222	207	207
query7	4215	455	251	251
query8	337	240	227	227
query9	8674	2859	2845	2845
query10	487	366	342	342
query11	14989	14985	14853	14853
query12	178	115	110	110
query13	1256	494	357	357
query14	6266	3025	2790	2790
query14_1	2662	2660	2635	2635
query15	211	198	178	178
query16	996	487	461	461
query17	1109	666	579	579
query18	2612	441	343	343
query19	219	220	197	197
query20	119	117	114	114
query21	221	138	121	121
query22	4005	4061	4137	4061
query23	16100	15648	15719	15648
query23_1	15546	15511	15741	15511
query24	6853	1549	1176	1176
query24_1	1171	1188	1177	1177
query25	563	475	429	429
query26	1234	268	158	158
query27	2754	444	285	285
query28	4364	2129	2130	2129
query29	789	557	451	451
query30	315	242	210	210
query31	805	628	577	577
query32	86	81	74	74
query33	544	362	322	322
query34	898	873	532	532
query35	710	757	679	679
query36	877	888	881	881
query37	145	105	89	89
query38	2657	2698	2654	2654
query39	770	747	732	732
query39_1	708	726	704	704
query40	220	136	118	118
query41	68	60	61	60
query42	100	100	99	99
query43	466	419	424	419
query44	1293	722	726	722
query45	180	188	182	182
query46	812	926	559	559
query47	1364	1424	1310	1310
query48	311	326	240	240
query49	606	426	339	339
query50	609	259	205	205
query51	3759	3825	3869	3825
query52	99	102	94	94
query53	282	320	262	262
query54	278	269	255	255
query55	79	76	76	76
query56	299	305	298	298
query57	1042	1033	910	910
query58	266	252	259	252
query59	2052	2094	2040	2040
query60	330	334	310	310
query61	149	190	151	151
query62	392	391	311	311
query63	295	263	261	261
query64	4682	1244	991	991
query65	3899	3764	3808	3764
query66	1391	421	306	306
query67	15588	15477	15438	15438
query68	2370	1071	731	731
query69	448	355	320	320
query70	987	955	973	955
query71	316	313	283	283
query72	5205	3236	3334	3236
query73	597	712	315	315
query74	8727	8758	8550	8550
query75	2732	2811	2442	2442
query76	1944	1042	660	660
query77	372	372	308	308
query78	9856	9997	9177	9177
query79	1073	922	567	567
query80	1320	584	486	486
query81	555	260	229	229
query82	892	140	106	106
query83	361	250	239	239
query84	259	111	89	89
query85	907	507	446	446
query86	422	298	284	284
query87	2828	2838	2775	2775
query88	3450	2559	2547	2547
query89	384	343	323	323
query90	2041	162	159	159
query91	172	160	135	135
query92	86	74	70	70
query93	1067	895	523	523
query94	626	306	302	302
query95	582	349	316	316
query96	629	501	224	224
query97	2350	2364	2310	2310
query98	210	208	197	197
query99	629	569	517	517
Total cold run time: 245265 ms
Total hot run time: 174466 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.10	0.05	0.05
query3	0.26	0.08	0.08
query4	1.61	0.11	0.11
query5	0.28	0.26	0.26
query6	1.16	0.66	0.65
query7	0.03	0.03	0.03
query8	0.06	0.04	0.04
query9	0.56	0.50	0.50
query10	0.54	0.56	0.54
query11	0.14	0.09	0.09
query12	0.15	0.11	0.11
query13	0.61	0.58	0.58
query14	0.97	0.95	0.93
query15	0.78	0.77	0.78
query16	0.39	0.39	0.40
query17	1.00	0.99	1.05
query18	0.23	0.21	0.21
query19	1.92	1.88	1.80
query20	0.02	0.01	0.01
query21	15.44	0.27	0.14
query22	5.12	0.06	0.05
query23	16.00	0.27	0.11
query24	1.44	0.62	0.55
query25	0.08	0.08	0.06
query26	0.13	0.13	0.13
query27	0.08	0.05	0.06
query28	3.76	1.08	0.89
query29	12.55	3.89	3.17
query30	0.28	0.14	0.12
query31	2.80	0.63	0.40
query32	3.23	0.56	0.46
query33	3.07	2.99	3.00
query34	16.42	5.03	4.51
query35	4.45	4.50	4.45
query36	0.64	0.49	0.49
query37	0.11	0.07	0.07
query38	0.08	0.04	0.04
query39	0.05	0.03	0.03
query40	0.17	0.15	0.14
query41	0.08	0.03	0.03
query42	0.05	0.03	0.02
query43	0.04	0.04	0.04
Total cold run time: 96.93 s
Total hot run time: 27.12 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 59.95% (259/432) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 60.00% (3/5) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.98% (18986/35839)
Line Coverage 39.02% (175874/450772)
Region Coverage 33.62% (136303/405379)
Branch Coverage 34.65% (58893/169976)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (5/5) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 72.20% (25358/35122)
Line Coverage 58.96% (265450/450187)
Region Coverage 53.80% (220506/409887)
Branch Coverage 55.44% (94654/170737)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 1.62% (7/432) 🎉
Increment coverage report
Complete coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants