This is an automated email from the ASF dual-hosted git repository. maxyang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 2f11cacb742d752c6c272369dbef5279e97a7768 Author: Zhenghua Lyu <[email protected]> AuthorDate: Tue May 30 03:33:00 2023 +0000 Only super user can set the GUC gp_resource_group_bypass. --- src/backend/utils/misc/guc_gp.c | 2 +- src/test/isolation2/expected/resgroup/resgroup_bypass.out | 6 ++++++ src/test/isolation2/sql/resgroup/resgroup_bypass.sql | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/misc/guc_gp.c b/src/backend/utils/misc/guc_gp.c index f37086e59f..e92de86dc3 100644 --- a/src/backend/utils/misc/guc_gp.c +++ b/src/backend/utils/misc/guc_gp.c @@ -2839,7 +2839,7 @@ struct config_bool ConfigureNamesBool_gp[] = }, { - {"gp_resource_group_bypass", PGC_USERSET, RESOURCES, + {"gp_resource_group_bypass", PGC_SUSET, RESOURCES, gettext_noop("If the value is true, the query in this session will not be limited by resource group."), NULL }, diff --git a/src/test/isolation2/expected/resgroup/resgroup_bypass.out b/src/test/isolation2/expected/resgroup/resgroup_bypass.out index 5cff41d745..090be7983d 100644 --- a/src/test/isolation2/expected/resgroup/resgroup_bypass.out +++ b/src/test/isolation2/expected/resgroup/resgroup_bypass.out @@ -19,6 +19,12 @@ SET ROLE role_bypass; SET CREATE TABLE t_bypass(a int) distributed by (a); CREATE + +-- gp_resource_group_bypass can only be set by super user +-- below set statement will error out +set gp_resource_group_bypass = 1; +ERROR: permission denied to set parameter "gp_resource_group_bypass" + RESET ROLE; RESET diff --git a/src/test/isolation2/sql/resgroup/resgroup_bypass.sql b/src/test/isolation2/sql/resgroup/resgroup_bypass.sql index 19c50771f7..d4d97fbd6b 100644 --- a/src/test/isolation2/sql/resgroup/resgroup_bypass.sql +++ b/src/test/isolation2/sql/resgroup/resgroup_bypass.sql @@ -12,6 +12,11 @@ CREATE ROLE role_bypass RESOURCE GROUP rg_bypass; SET ROLE role_bypass; CREATE TABLE t_bypass(a int) distributed by (a); + +-- gp_resource_group_bypass can only be set by super user +-- below set statement will error out +set gp_resource_group_bypass = 1; + RESET ROLE; -- Session1: pure-catalog query will be unassigned and bypassed. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
