Skip to content

[fix](fe) Allow show tablet without selected database#63280

Open
englefly wants to merge 1 commit into
apache:masterfrom
englefly:show-tablet
Open

[fix](fe) Allow show tablet without selected database#63280
englefly wants to merge 1 commit into
apache:masterfrom
englefly:show-tablet

Conversation

@englefly
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Problem Summary: SHOW TABLET <tablet_id> looked up tablet metadata by id but still required a selected session database during validation. This caused No database selected when the mysql client had not executed USE , even though the command can resolve the owning database from TabletMeta.
Issue Number: close #xxx

Related PR: #48815

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

@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?

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17616	3845	3793	3793
q2	q3	10742	1357	769	769
q4	4683	470	339	339
q5	7666	2199	2071	2071
q6	250	173	142	142
q7	926	763	633	633
q8	9422	1730	1673	1673
q9	6422	4880	4897	4880
q10	6433	2104	1791	1791
q11	438	269	238	238
q12	694	426	296	296
q13	18193	3363	2768	2768
q14	259	247	238	238
q15	q16	831	779	713	713
q17	1004	963	1030	963
q18	6829	5843	5468	5468
q19	1256	1195	1085	1085
q20	690	448	289	289
q21	6101	2774	2471	2471
q22	443	377	316	316
Total cold run time: 100898 ms
Total hot run time: 30936 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4658	4565	4703	4565
q2	q3	4780	5159	4697	4697
q4	2109	2230	1390	1390
q5	4771	4721	4534	4534
q6	228	173	131	131
q7	1831	1709	1533	1533
q8	2356	2092	1919	1919
q9	7238	7284	7210	7210
q10	4558	4422	4009	4009
q11	544	378	351	351
q12	701	715	524	524
q13	3007	3333	2779	2779
q14	262	284	270	270
q15	q16	676	695	603	603
q17	1254	1224	1222	1222
q18	7300	6836	6909	6836
q19	1156	1113	1122	1113
q20	2218	2217	1926	1926
q21	5312	4602	4476	4476
q22	507	472	428	428
Total cold run time: 55466 ms
Total hot run time: 50516 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 169307 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 568226f9cfc3457a85851e51fb4d8ff97bb34f75, data reload: false

query5	4311	636	531	531
query6	342	214	196	196
query7	4229	559	311	311
query8	323	236	218	218
query9	8801	4027	4069	4027
query10	461	347	311	311
query11	5819	2407	2179	2179
query12	188	135	123	123
query13	1283	594	442	442
query14	5961	5356	5125	5125
query14_1	4350	4348	4347	4347
query15	208	206	182	182
query16	1006	454	443	443
query17	1109	706	575	575
query18	2516	492	348	348
query19	215	206	156	156
query20	141	132	126	126
query21	214	136	117	117
query22	13635	13576	13298	13298
query23	17201	16346	16065	16065
query23_1	16269	16127	16211	16127
query24	7448	1752	1284	1284
query24_1	1291	1273	1296	1273
query25	544	488	449	449
query26	1303	319	166	166
query27	2711	550	333	333
query28	4441	1966	1933	1933
query29	997	605	497	497
query30	300	237	196	196
query31	1106	1067	938	938
query32	86	74	72	72
query33	526	342	297	297
query34	1163	1122	664	664
query35	746	790	681	681
query36	1296	1311	1172	1172
query37	151	106	107	106
query38	3231	3151	3073	3073
query39	930	929	904	904
query39_1	883	877	882	877
query40	240	153	127	127
query41	75	68	70	68
query42	116	127	115	115
query43	328	342	298	298
query44	
query45	213	204	195	195
query46	1060	1180	730	730
query47	2466	2353	2291	2291
query48	431	439	317	317
query49	653	515	412	412
query50	1042	373	257	257
query51	4403	4266	4303	4266
query52	117	109	99	99
query53	271	288	221	221
query54	340	315	267	267
query55	94	92	103	92
query56	329	321	325	321
query57	1447	1405	1341	1341
query58	304	294	277	277
query59	1577	1615	1449	1449
query60	331	338	324	324
query61	178	180	182	180
query62	673	643	551	551
query63	252	206	206	206
query64	2460	857	709	709
query65	
query66	2041	466	347	347
query67	29960	30000	29852	29852
query68	
query69	471	331	300	300
query70	1009	1015	921	921
query71	293	277	259	259
query72	3025	2680	2472	2472
query73	880	801	418	418
query74	5064	4934	4704	4704
query75	2656	2586	2249	2249
query76	2278	1112	741	741
query77	414	416	326	326
query78	12121	12148	11600	11600
query79	1455	1014	758	758
query80	1331	535	456	456
query81	519	287	236	236
query82	1224	160	124	124
query83	354	282	249	249
query84	266	143	110	110
query85	917	547	445	445
query86	454	332	295	295
query87	3455	3350	3217	3217
query88	3525	2688	2668	2668
query89	441	391	334	334
query90	1929	182	177	177
query91	179	174	140	140
query92	78	77	77	77
query93	1610	1489	857	857
query94	735	337	288	288
query95	663	372	432	372
query96	1089	746	348	348
query97	2705	2681	2567	2567
query98	237	230	226	226
query99	1124	1152	1006	1006
Total cold run time: 254547 ms
Total hot run time: 169307 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 10.53% (2/19) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

run p0

@englefly
Copy link
Copy Markdown
Contributor Author

run cloud_p0

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 1.26% (2/159) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 1.23% (2/163) 🎉
Increment coverage report
Complete coverage report

Issue Number: None

Related PR: None

Problem Summary: SHOW TABLET <tablet_id> looked up tablet metadata by id but still required a selected session database during validation. This caused No database selected when the mysql client had not executed USE <db>, even though the command can resolve the owning database from TabletMeta.

None

- Test: Regression test / Unit Test
    - tools/fast-compile-fe.sh fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowTabletIdCommand.java
    - tools/fast-compile-fe.sh --test fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/commands/ShowTabletIdCommandTest.java
    - ./run-regression-test.sh --run -d show_p0 -s test_show_tablet
    - cd fe && mvn checkstyle:check -pl fe-core -Dcheckstyle.includes='**/ShowTabletIdCommand.java,**/ShowTabletIdCommandTest.java'
    - Manual test: mysql -h :: -u root -P 29031 -e 'show tablet 1778657405980;'
- Behavior changed: Yes. SHOW TABLET <tablet_id> no longer requires a selected database.
@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17656	3909	3880	3880
q2	q3	10738	1380	783	783
q4	4685	467	347	347
q5	7550	2224	2084	2084
q6	238	176	137	137
q7	955	795	641	641
q8	9461	1665	1735	1665
q9	6595	4927	4872	4872
q10	6419	2090	1768	1768
q11	436	268	250	250
q12	695	426	301	301
q13	18289	3371	2749	2749
q14	263	256	243	243
q15	q16	820	765	706	706
q17	990	959	958	958
q18	7219	5688	5495	5495
q19	1202	1252	1112	1112
q20	509	399	266	266
q21	5688	2600	2328	2328
q22	444	358	306	306
Total cold run time: 100852 ms
Total hot run time: 30891 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4189	4170	4108	4108
q2	q3	4516	4890	4312	4312
q4	2114	2196	1404	1404
q5	4388	4268	4234	4234
q6	222	174	130	130
q7	2129	1868	1687	1687
q8	2443	2066	2046	2046
q9	7881	7735	7701	7701
q10	4607	4467	4099	4099
q11	560	566	369	369
q12	716	735	518	518
q13	3317	3567	3023	3023
q14	300	293	275	275
q15	q16	714	759	670	670
q17	1327	1315	1307	1307
q18	7882	7530	6858	6858
q19	1133	1086	1111	1086
q20	2210	2199	1932	1932
q21	5306	4606	4493	4493
q22	523	458	404	404
Total cold run time: 56477 ms
Total hot run time: 50656 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 169945 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 6d3dfb28aebc8363f1ffc9b66e9f3f68e32b2d30, data reload: false

query5	4329	641	526	526
query6	343	222	203	203
query7	4242	568	293	293
query8	328	235	226	226
query9	8836	4048	4008	4008
query10	471	343	307	307
query11	5728	2366	2165	2165
query12	188	135	130	130
query13	1258	657	426	426
query14	5949	5334	5043	5043
query14_1	4346	4369	4329	4329
query15	211	202	185	185
query16	1001	449	410	410
query17	1115	717	584	584
query18	2622	464	339	339
query19	232	203	176	176
query20	144	130	130	130
query21	219	142	117	117
query22	13715	13548	13437	13437
query23	17224	16307	16077	16077
query23_1	16168	16117	16260	16117
query24	7471	1737	1320	1320
query24_1	1296	1326	1319	1319
query25	577	525	453	453
query26	1312	330	178	178
query27	2698	537	361	361
query28	4429	1997	1973	1973
query29	1004	661	525	525
query30	305	240	203	203
query31	1123	1060	941	941
query32	89	83	74	74
query33	566	369	307	307
query34	1177	1135	607	607
query35	830	790	716	716
query36	1368	1343	1153	1153
query37	157	106	95	95
query38	3276	3155	3070	3070
query39	933	925	899	899
query39_1	888	893	903	893
query40	242	153	131	131
query41	86	75	68	68
query42	115	113	111	111
query43	328	334	299	299
query44	
query45	222	206	196	196
query46	1052	1175	719	719
query47	2341	2327	2182	2182
query48	409	446	299	299
query49	656	512	410	410
query50	974	349	265	265
query51	4320	4313	4272	4272
query52	107	109	100	100
query53	262	288	209	209
query54	348	307	269	269
query55	94	95	86	86
query56	319	337	329	329
query57	1439	1390	1315	1315
query58	310	277	281	277
query59	1543	1632	1381	1381
query60	368	346	371	346
query61	162	152	155	152
query62	683	636	562	562
query63	242	203	209	203
query64	2396	812	638	638
query65	
query66	1676	468	359	359
query67	30094	29928	29857	29857
query68	
query69	472	330	295	295
query70	1047	941	998	941
query71	304	277	267	267
query72	2981	2679	2418	2418
query73	846	725	435	435
query74	5065	4927	4760	4760
query75	2675	2604	2265	2265
query76	2292	1141	766	766
query77	406	420	335	335
query78	12209	12002	11605	11605
query79	1445	1029	704	704
query80	643	538	473	473
query81	470	279	243	243
query82	1374	164	123	123
query83	353	280	259	259
query84	261	142	111	111
query85	881	582	459	459
query86	396	322	325	322
query87	3449	3388	3222	3222
query88	3536	2685	2656	2656
query89	443	390	334	334
query90	1961	183	179	179
query91	177	171	149	149
query92	87	78	74	74
query93	1465	1436	857	857
query94	559	365	323	323
query95	688	393	436	393
query96	1012	785	351	351
query97	2684	2736	2556	2556
query98	242	230	226	226
query99	1132	1112	998	998
Total cold run time: 253358 ms
Total hot run time: 169945 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/264) 🎉
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.

2 participants