Pivotal Knowledge Base

Follow

How to Remove Workload Manager Assignment Rules

Environment

Pivotal Greenplum Database (GPDB) 5.5.0 and above

Purpose

This article describes how to correctly set, edit, and remove Workload Manager Assignment Rules.

Cause 

Do not remove lines from the workload manager database table gpcc.workload_config. This table is where the Assignment Rules are stored once created. This table is used by the gp_wlm extension and Greenplum Command Center (GPCC) and should not be edited manually.

Procedure

The only way to edit the Assignment Rules is to use gpcc.set_workload_config function. With this, users can create new rules and edit existing rules. The only way to remove the rules is to use the gpcc.set_workload_config function but leave the assignment filters blank.

1. Use the following procedure to create an Assignment Rule: 

select gpcc.set_workload_config('{ "version": 1, "assignmentRules": [{ "resourceGroupName": "super_rg", "queryTags": "appName=tableau" }] }');
postgres=# select gpcc.get_workload_config();
get_workload_config
-------------------------------------------------------------------------------------
{ "version": 1, "assignmentRules": [{ "resourceGroupName": "super_rg", "queryTags": "appName=tableau" }] }
(1 row)

2. Use the following procedure to remove the Assignment Filter:

select gpcc.set_workload_config('{ "version": 1, "assignmentRules": [{ "resourceGroupName": "", "queryTags": "" }] }');

3. Use either of the following commands to verify the rule has been removed:

postgres=# select gpcc.get_workload_config();
get_workload_config
-------------------------------------------------------------------------------------
{ "version": 1, "assignmentRules": [{ "resourceGroupName": "", "queryTags": "" }] }
(1 row) postgres=# select * from gpcc.workload_config;
dist_col | config
----------+-------------------------------------------------------------------------------------
1 | { "version": 1, "assignmentRules": [{ "resourceGroupName": "", "queryTags": "" }] }
(1 row)

Alternatively, use the disabled "True" Parameter to disable the assignment rule.

select gpcc.set_workload_config('{ "version": 1, "assignmentRules": [{ "resourceGroupName": "super_rg", "queryTags": "appName=tableau", "disabled" "true"}] }');

Additional Information

The only way to recover the rows that have been manually deleted from the gpcc.workload_config table is to drop and recreate the gp_wlm extension and rerun the set_workload_config function to update the gpcc.workload_config table. The reason for this is that the shared memory cache will not be updated if a manual manipulation of this table is performed. See Managing Workload Query Assignment Filters for the further information on the Workload Manager Assignment Rules.

Comments

Powered by Zendesk