diff --git a/drainer/schema.go b/drainer/schema.go index 8d549534d..839739c3a 100644 --- a/drainer/schema.go +++ b/drainer/schema.go @@ -344,6 +344,8 @@ func skipUnsupportedDDLJob(job *model.Job) bool { case model.ActionCreatePlacementPolicy, model.ActionAlterPlacementPolicy, model.ActionDropPlacementPolicy, model.ActionAlterTablePartitionPlacement, model.ActionModifySchemaDefaultPlacement, model.ActionAlterTablePlacement: return true + case model.ActionCreateResourceGroup, model.ActionAlterResourceGroup, model.ActionDropResourceGroup: + return true } return false diff --git a/tests/resource_control/drainer.toml b/tests/resource_control/drainer.toml new file mode 100644 index 000000000..f087e95a0 --- /dev/null +++ b/tests/resource_control/drainer.toml @@ -0,0 +1,17 @@ +data-dir = '/tmp/tidb_binlog_test/data.drainer' + +[syncer] +txn-batch = 1 +worker-count = 1 +safe-mode = false +db-type = 'mysql' +replicate-do-db = ['resource_control_test'] + +[syncer.to] +host = '127.0.0.1' +user = 'root' +password = '' +port = 3306 + +[syncer.to.checkpoint] +schema = "resource_control_checkpoint" diff --git a/tests/resource_control/run.sh b/tests/resource_control/run.sh new file mode 100644 index 000000000..01012d14a --- /dev/null +++ b/tests/resource_control/run.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")" + +run_drainer --compressor gzip & + +sleep 3 + +run_sql 'CREATE DATABASE resource_control_test;' +run_sql 'CREATE RESOURCE GROUP rg1 RU_PER_SEC=10000;' +run_sql 'CREATE RESOURCE GROUP rg2 RU_PER_SEC=5000;' +run_sql 'ALTER RESOURCE GROUP rg1 RU_PER_SEC=10000, BURSTABLE;' +run_sql 'DROP RESOURCE GROUP rg2;' + +sleep 3 + +run_sql 'DROP DATABASE resource_control_test;' + +killall drainer