diff --git a/src/backend/utils/resgroup/resgroup-ops-linux.c b/src/backend/utils/resgroup/resgroup-ops-linux.c index 1efab77b2d3097a351cfc005f436889ae726235d..3c2011844f76825ba378bf955a92689494bdb458 100644 --- a/src/backend/utils/resgroup/resgroup-ops-linux.c +++ b/src/backend/utils/resgroup/resgroup-ops-linux.c @@ -99,9 +99,6 @@ static bool detectCgroupMountPoint(void); static Oid currentGroupIdInCGroup = InvalidOid; static char cgdir[MAXPGPATH]; -bool gp_resource_group_enable_cgroup_memory = false; -bool gp_resource_group_enable_cgroup_swap = false; - /* * These checks should keep in sync with gpMgmt/bin/gpcheckresgroupimpl */ diff --git a/src/backend/utils/resgroup/resgroup.c b/src/backend/utils/resgroup/resgroup.c index 577e969d11b9f1586e9bcdf98fb8148e8634ba25..48ba0aa2347c8004d7417962e06de4dc8a2d9ca2 100644 --- a/src/backend/utils/resgroup/resgroup.c +++ b/src/backend/utils/resgroup/resgroup.c @@ -232,6 +232,9 @@ struct ResGroupControl ResGroupData groups[1]; }; +bool gp_resource_group_enable_cgroup_memory = false; +bool gp_resource_group_enable_cgroup_swap = false; + /* hooks */ resgroup_assign_hook_type resgroup_assign_hook = NULL; @@ -641,9 +644,10 @@ ResGroupDropFinish(Oid groupId, bool isCommit) { savedInterruptHoldoffCount = InterruptHoldoffCount; + group = groupHashFind(groupId, true); + if (Gp_role == GP_ROLE_DISPATCH) { - group = groupHashFind(groupId, true); wakeupSlots(group, false); unlockResGroupForDrop(group); } @@ -652,11 +656,11 @@ ResGroupDropFinish(Oid groupId, bool isCommit) { bool migrate; - removeGroup(groupId); - /* Only migrate processes out of vmtracker groups */ migrate = group->memAuditor == RESGROUP_MEMORY_AUDITOR_VMTRACKER; + removeGroup(groupId); + ResGroupOps_DestroyGroup(groupId, migrate); } }