You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "heguanhui (via GitHub)" <gi...@apache.org> on 2026/05/25 14:16:06 UTC

[PR] [fix](fe) Cascade revoke privileges when dropping resources [doris]

heguanhui opened a new pull request, #63632:
URL: https://github.com/apache/doris/pull/63632

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Problem Summary: When a resource (database, table, resource, workload group, or catalog) is dropped, the corresponding privilege entries in roles are not cleaned up. This causes `SHOW GRANTS` to display orphan privileges that reference non-existent resources. These orphan entries persist across FE restarts because the original GRANT records are replayed from BDB edit logs without any corresponding cleanup.
   
   ### Release note
   
   Fix orphan privilege entries displayed by `SHOW GRANTS` after dropping databases, tables, resources, workload groups, or catalogs. Privileges referencing dropped resources are now cascade-revoked automatically.
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
       - [x] 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.
       - [x] Yes. Dropping a database/table/resource/workload group/catalog now cascade-revokes all privilege entries referencing that resource across all roles.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](fe) Cascade revoke privileges when dropping resources [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #63632:
URL: https://github.com/apache/doris/pull/63632#issuecomment-4539174257

   # FE UT Coverage Report
   Increment line coverage `  57.53% (84/146)` :tada:
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/63632_ad9b2b27c992dbf192e600bf94e21a4bbe63dadb/fe_increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/63632_ad9b2b27c992dbf192e600bf94e21a4bbe63dadb/fe_report/index.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](fe) Cascade revoke privileges when dropping resources [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #63632:
URL: https://github.com/apache/doris/pull/63632#issuecomment-4539921150

   # FE Regression Coverage Report
   Increment line coverage `  93.29% (139/149)` :tada:
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/63632_ad9b2b27c992dbf192e600bf94e21a4bbe63dadb_merge_fe/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/63632_ad9b2b27c992dbf192e600bf94e21a4bbe63dadb_merge_fe/report/index.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](fe) Cascade revoke privileges when dropping resources [doris]

Posted by "heguanhui (via GitHub)" <gi...@apache.org>.
heguanhui commented on PR #63632:
URL: https://github.com/apache/doris/pull/63632#issuecomment-4538649398

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](fe) Cascade revoke privileges when dropping resources [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #63632:
URL: https://github.com/apache/doris/pull/63632#issuecomment-4538925382

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 173007 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit ad9b2b27c992dbf192e600bf94e21a4bbe63dadb, data reload: false
   
   query5	4321	689	518	518
   query6	351	227	221	221
   query7	4263	571	314	314
   query8	349	243	232	232
   query9	8852	4228	4214	4214
   query10	451	350	313	313
   query11	5797	2720	2216	2216
   query12	185	137	127	127
   query13	1285	618	434	434
   query14	6167	5545	5295	5295
   query14_1	4613	4571	4603	4571
   query15	217	208	196	196
   query16	999	448	426	426
   query17	1009	736	592	592
   query18	2441	492	355	355
   query19	213	194	169	169
   query20	145	130	129	129
   query21	220	141	115	115
   query22	13705	13683	13466	13466
   query23	17317	16522	16323	16323
   query23_1	16416	16419	16408	16408
   query24	7435	1795	1332	1332
   query24_1	1333	1338	1342	1338
   query25	572	481	429	429
   query26	1317	309	170	170
   query27	2701	565	352	352
   query28	4461	2036	2017	2017
   query29	993	612	502	502
   query30	309	234	199	199
   query31	1126	1083	955	955
   query32	95	81	74	74
   query33	530	356	326	326
   query34	1207	1154	656	656
   query35	787	802	698	698
   query36	1382	1414	1272	1272
   query37	157	103	101	101
   query38	3243	3185	3142	3142
   query39	951	935	906	906
   query39_1	899	901	883	883
   query40	227	144	131	131
   query41	65	62	65	62
   query42	116	108	111	108
   query43	352	351	314	314
   query44	
   query45	230	205	204	204
   query46	1114	1240	744	744
   query47	2388	2376	2252	2252
   query48	402	424	298	298
   query49	629	537	392	392
   query50	1046	357	251	251
   query51	4332	4274	4267	4267
   query52	108	106	95	95
   query53	260	279	212	212
   query54	308	265	249	249
   query55	95	91	88	88
   query56	310	310	308	308
   query57	1466	1386	1350	1350
   query58	297	270	281	270
   query59	1671	1761	1525	1525
   query60	323	333	324	324
   query61	157	153	155	153
   query62	695	655	580	580
   query63	245	206	212	206
   query64	2386	838	642	642
   query65	
   query66	1745	482	350	350
   query67	29380	29822	29588	29588
   query68	
   query69	475	342	308	308
   query70	1003	1018	977	977
   query71	303	277	267	267
   query72	3007	2725	2286	2286
   query73	851	749	452	452
   query74	5138	4975	4855	4855
   query75	2722	2638	2309	2309
   query76	2312	1167	793	793
   query77	419	434	371	371
   query78	12360	12423	11765	11765
   query79	1467	1002	736	736
   query80	677	580	496	496
   query81	449	284	245	245
   query82	1376	160	130	130
   query83	374	296	265	265
   query84	299	146	126	126
   query85	978	608	537	537
   query86	426	343	330	330
   query87	3445	3410	3278	3278
   query88	3677	2764	2770	2764
   query89	455	397	349	349
   query90	1901	191	192	191
   query91	199	222	140	140
   query92	77	78	74	74
   query93	1502	1405	879	879
   query94	550	348	313	313
   query95	669	395	343	343
   query96	1117	818	368	368
   query97	2737	2734	2603	2603
   query98	240	231	239	231
   query99	1173	1163	1027	1027
   Total cold run time: 254461 ms
   Total hot run time: 173007 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](fe) Cascade revoke privileges when dropping resources [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #63632:
URL: https://github.com/apache/doris/pull/63632#issuecomment-4534938287

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/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?
       


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](fe) Cascade revoke privileges when dropping resources [doris]

Posted by "heguanhui (via GitHub)" <gi...@apache.org>.
heguanhui commented on PR #63632:
URL: https://github.com/apache/doris/pull/63632#issuecomment-4603840998

   /review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](fe) Cascade revoke privileges when dropping resources [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #63632:
URL: https://github.com/apache/doris/pull/63632#issuecomment-4538835932

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 31566 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit ad9b2b27c992dbf192e600bf94e21a4bbe63dadb, 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	17746	4235	4154	4154
   q2	q3	10832	1386	835	835
   q4	4686	481	352	352
   q5	7653	2269	2154	2154
   q6	262	180	137	137
   q7	974	786	655	655
   q8	9422	1881	1636	1636
   q9	7100	4995	5011	4995
   q10	6441	2223	1873	1873
   q11	436	274	246	246
   q12	687	436	306	306
   q13	18225	3469	2777	2777
   q14	277	259	238	238
   q15	q16	835	775	709	709
   q17	987	989	940	940
   q18	6730	5722	5484	5484
   q19	1159	1418	1086	1086
   q20	523	401	261	261
   q21	5899	2670	2418	2418
   q22	442	368	310	310
   Total cold run time: 101316 ms
   Total hot run time: 31566 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	4475	4448	4417	4417
   q2	q3	4545	4946	4358	4358
   q4	2134	2229	1425	1425
   q5	4481	4347	5096	4347
   q6	267	201	156	156
   q7	2023	1987	1615	1615
   q8	2568	2239	2242	2239
   q9	8085	8024	7919	7919
   q10	4826	4964	4346	4346
   q11	608	461	395	395
   q12	763	780	564	564
   q13	3330	3726	3006	3006
   q14	293	310	290	290
   q15	q16	747	740	699	699
   q17	1403	1366	1385	1366
   q18	7966	7364	6923	6923
   q19	1168	1086	1090	1086
   q20	2246	2234	1973	1973
   q21	5357	4663	4500	4500
   q22	540	479	416	416
   Total cold run time: 57825 ms
   Total hot run time: 52040 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org