Skip to content

branch-3.1: [Fix](MS)Handle missing endpoint in DLF-only Metastore scenario with region fallback #54300 - #54522

Merged
morrySnow merged 1 commit into
branch-3.1from
auto-pick-54300-branch-3.1
Aug 13, 2025
Merged

branch-3.1: [Fix](MS)Handle missing endpoint in DLF-only Metastore scenario with region fallback #54300#54522
morrySnow merged 1 commit into
branch-3.1from
auto-pick-54300-branch-3.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #54300

…region fallback (#54300)

#50238 

### PR Description
This PR fixes a special case where the endpoint parameter might be
missing when using DLF as the Hive Metastore (MS) without configuring
any storage backend.

#### Background
In certain deployments, users rely solely on DLF as the metastore and do
not explicitly configure object storage credentials. In these cases:

Only DLF access_key, secret_key, and region are provided.

dlf.endpoint is omitted by the user.

```
 create catalog if not exists pm_dlf properties (
            "type" = "paimon",
            "paimon.catalog.type" = "dlf",
            "warehouse" = "oss://asf-doris-datalake-test/p2_regression_case",
            "dlf.proxy.mode" = "DLF_ONLY",
            "dlf.uid" = "1289998888",

            "dlf.region" = "cn-beijing",
            "dlf.catalog.id" = "asf",
            "dlf.access_key" = "ABSHJJJKKKLKJHVGFGHJKLKJHGHJKJHGHJK",
            "dlf.secret_key" = "UYGFHJKHGVVHBJKHVGBJKL:JHGVBJKLHVGHJHVGH"
            );

switch pm_dlf;

show databases;
exception: 

Exception:java.sql.SQLException: errCode = 2, detailMessage = UserException: errCode = 2, detailMessage = No storage properties found for schema: oss  at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)  at 
```


The system attempts to initialize storage configuration, but fails
because endpoint is required.

This issue occurs because the existing logic assumes that the storage
module always receives a valid endpoint, which is not the case when DLF
is used as MS only.

#### Fix
When dlf.endpoint is not set, and dlf.region is available, this patch
automatically derives a valid default endpoint based on the region and
network mode (public or VPC).

This logic is consistent with the existing behavior of DLF SDKs and
avoids unnecessary configuration burden for users using DLF as MS only.

#### Compatibility
Backward compatible: No breaking change for users who already provide an
endpoint.

Recommended best practice remains: Users are encouraged to explicitly
configure both endpoint and region for clarity.
@github-actions
github-actions Bot requested a review from morrySnow as a code owner August 10, 2025 03:15
@hello-stephen

Copy link
Copy Markdown
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?

@dataroaring dataroaring reopened this Aug 10, 2025
@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

@doris-robot

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

------ Round 1 ----------------------------------
q1	17583	5551	5429	5429
q2	2024	426	289	289
q3	12262	1211	755	755
q4	10560	867	445	445
q5	9558	2365	2129	2129
q6	185	162	134	134
q7	899	742	620	620
q8	9334	1398	1115	1115
q9	5389	4930	4897	4897
q10	6765	2266	1818	1818
q11	477	281	258	258
q12	340	360	214	214
q13	17777	3638	2986	2986
q14	221	222	221	221
q15	554	477	469	469
q16	440	426	379	379
q17	593	848	353	353
q18	6880	6235	6391	6235
q19	1218	953	554	554
q20	333	334	209	209
q21	3077	2180	2026	2026
q22	1067	1034	966	966
Total cold run time: 107536 ms
Total hot run time: 32501 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5531	5552	5489	5489
q2	237	326	243	243
q3	2212	2644	2316	2316
q4	1352	1790	1366	1366
q5	4396	4971	5025	4971
q6	159	157	125	125
q7	2016	1974	1811	1811
q8	2582	2785	2660	2660
q9	7187	7163	7269	7163
q10	3047	3314	2707	2707
q11	570	527	508	508
q12	681	793	642	642
q13	3400	3770	3126	3126
q14	280	315	273	273
q15	524	481	473	473
q16	441	474	446	446
q17	1217	1717	1238	1238
q18	7641	7359	7286	7286
q19	787	1109	1109	1109
q20	1994	2064	1890	1890
q21	5316	4912	4554	4554
q22	1054	1047	1036	1036
Total cold run time: 52624 ms
Total hot run time: 51432 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 192262 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 f49cbe92dd88e639a170740ac8e39b6e9712ccc1, data reload: false

query1	951	392	385	385
query2	6219	1934	1882	1882
query3	8693	201	191	191
query4	33518	23809	23528	23528
query5	3680	618	446	446
query6	310	191	170	170
query7	4196	499	303	303
query8	299	240	230	230
query9	9347	2563	2544	2544
query10	456	320	262	262
query11	17895	15472	15136	15136
query12	156	119	106	106
query13	1555	527	405	405
query14	9754	7192	7105	7105
query15	235	194	180	180
query16	8042	655	525	525
query17	1610	764	602	602
query18	2137	438	317	317
query19	228	189	168	168
query20	126	127	120	120
query21	211	131	111	111
query22	4660	4720	4550	4550
query23	35164	34097	34298	34097
query24	7410	2688	2692	2688
query25	533	482	419	419
query26	1220	298	175	175
query27	1972	495	352	352
query28	5102	2147	2108	2108
query29	765	589	477	477
query30	240	196	167	167
query31	987	939	842	842
query32	87	58	59	58
query33	520	368	324	324
query34	787	857	538	538
query35	784	827	735	735
query36	1068	1051	984	984
query37	101	90	73	73
query38	3999	4063	4001	4001
query39	1547	1489	1463	1463
query40	201	117	103	103
query41	51	53	49	49
query42	126	112	117	112
query43	522	516	486	486
query44	1394	827	805	805
query45	190	185	174	174
query46	877	1049	684	684
query47	1996	2007	1894	1894
query48	391	410	363	363
query49	772	489	403	403
query50	689	703	421	421
query51	7383	7381	7185	7185
query52	105	101	91	91
query53	237	269	200	200
query54	544	550	468	468
query55	87	77	80	77
query56	268	270	270	270
query57	1287	1301	1247	1247
query58	257	229	213	213
query59	3213	3333	3056	3056
query60	305	285	273	273
query61	119	119	111	111
query62	808	748	693	693
query63	228	190	198	190
query64	4610	1023	646	646
query65	3400	3257	3303	3257
query66	1061	422	313	313
query67	16407	16052	15602	15602
query68	7450	823	522	522
query69	482	303	263	263
query70	1166	1120	1098	1098
query71	388	293	267	267
query72	5974	3829	3764	3764
query73	632	746	352	352
query74	10607	9097	8925	8925
query75	3246	3154	2658	2658
query76	3252	1197	780	780
query77	664	368	274	274
query78	10329	10536	9703	9703
query79	3464	894	588	588
query80	614	516	437	437
query81	507	255	224	224
query82	605	122	91	91
query83	170	160	145	145
query84	249	102	79	79
query85	803	383	302	302
query86	386	318	308	308
query87	4376	4341	4241	4241
query88	5077	2392	2379	2379
query89	412	340	294	294
query90	1763	184	186	184
query91	143	143	111	111
query92	69	56	52	52
query93	2118	874	540	540
query94	686	401	324	324
query95	343	281	272	272
query96	495	610	278	278
query97	3237	3299	3135	3135
query98	236	204	202	202
query99	1532	1441	1317	1317
Total cold run time: 295567 ms
Total hot run time: 192262 ms

@doris-robot

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

query1	0.04	0.03	0.03
query2	0.06	0.03	0.03
query3	0.24	0.06	0.06
query4	1.62	0.11	0.11
query5	0.54	0.51	0.53
query6	1.13	0.74	0.72
query7	0.02	0.02	0.01
query8	0.04	0.03	0.03
query9	0.58	0.52	0.47
query10	0.56	0.55	0.56
query11	0.15	0.11	0.11
query12	0.14	0.11	0.11
query13	0.62	0.60	0.59
query14	0.79	0.78	0.79
query15	0.84	0.87	0.82
query16	0.39	0.37	0.38
query17	1.05	1.01	1.04
query18	0.23	0.22	0.21
query19	2.00	1.88	1.90
query20	0.02	0.01	0.01
query21	15.39	0.91	0.61
query22	0.74	0.84	0.63
query23	15.14	1.38	0.54
query24	3.64	1.71	1.32
query25	0.23	0.09	0.29
query26	0.24	0.14	0.14
query27	0.05	0.05	0.06
query28	13.76	0.93	0.43
query29	12.55	3.99	3.23
query30	0.26	0.09	0.06
query31	2.83	0.59	0.38
query32	3.23	0.54	0.46
query33	2.97	3.00	2.99
query34	16.46	5.17	4.50
query35	4.56	4.61	4.55
query36	0.64	0.49	0.48
query37	0.08	0.06	0.06
query38	0.04	0.04	0.03
query39	0.03	0.02	0.02
query40	0.18	0.14	0.13
query41	0.08	0.03	0.02
query42	0.03	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 104.22 s
Total hot run time: 29.18 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 68.10% (79/116) 🎉
Increment coverage report
Complete coverage report

@morrySnow
morrySnow merged commit 1ffec7c into branch-3.1 Aug 13, 2025
23 checks passed
@github-actions
github-actions Bot deleted the auto-pick-54300-branch-3.1 branch August 13, 2025 04:05
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