Remove pg_dist_rebalence_strategy_enterprise_check (#5014)

This is not necessary anymore now that the rebalancer is open source.
pull/5016/head
Jelte Fennema 2021-06-01 15:16:46 +02:00 committed by GitHub
parent e2704d9ad9
commit 4c20bf7a36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 10 deletions

View File

@ -2786,13 +2786,12 @@ UpdateColocatedShardPlacementProgress(uint64 shardId, char *sourceName, int sour
/* /*
* citus_rebalance_strategy_enterprise_check is trigger function, intended for * pg_dist_rebalance_strategy_enterprise_check is a now removed function, but
* use in prohibiting writes to pg_dist_rebalance_strategy in Citus Community. * to avoid issues during upgrades a C stub is kept.
*/ */
Datum Datum
pg_dist_rebalance_strategy_enterprise_check(PG_FUNCTION_ARGS) pg_dist_rebalance_strategy_enterprise_check(PG_FUNCTION_ARGS)
{ {
/* This is Enterprise, so this check is a no-op */
PG_RETURN_VOID(); PG_RETURN_VOID();
} }

View File

@ -44,3 +44,6 @@ WHERE repmodel = 'c'
AND partmethod = 'h' AND partmethod = 'h'
AND logicalrelid NOT IN (SELECT * FROM replicated_relations); AND logicalrelid NOT IN (SELECT * FROM replicated_relations);
#include "udfs/citus_shards/10.1-1.sql" #include "udfs/citus_shards/10.1-1.sql"
DROP TRIGGER pg_dist_rebalance_strategy_enterprise_check_trigger ON pg_catalog.pg_dist_rebalance_strategy;
DROP FUNCTION citus_internal.pg_dist_rebalance_strategy_enterprise_check();

View File

@ -76,4 +76,11 @@ ORDER BY
; ;
#include "../udfs/citus_finish_pg_upgrade/10.0-1.sql" #include "../udfs/citus_finish_pg_upgrade/10.0-1.sql"
CREATE FUNCTION citus_internal.pg_dist_rebalance_strategy_enterprise_check()
RETURNS TRIGGER
LANGUAGE C
AS 'MODULE_PATHNAME';
CREATE TRIGGER pg_dist_rebalance_strategy_enterprise_check_trigger
BEFORE INSERT OR UPDATE OR DELETE OR TRUNCATE ON pg_dist_rebalance_strategy
FOR EACH STATEMENT EXECUTE FUNCTION citus_internal.pg_dist_rebalance_strategy_enterprise_check();

View File

@ -23,7 +23,6 @@ BEGIN
INSERT INTO pg_catalog.pg_dist_authinfo SELECT * FROM public.pg_dist_authinfo; INSERT INTO pg_catalog.pg_dist_authinfo SELECT * FROM public.pg_dist_authinfo;
INSERT INTO pg_catalog.pg_dist_poolinfo SELECT * FROM public.pg_dist_poolinfo; INSERT INTO pg_catalog.pg_dist_poolinfo SELECT * FROM public.pg_dist_poolinfo;
ALTER TABLE pg_catalog.pg_dist_rebalance_strategy DISABLE TRIGGER pg_dist_rebalance_strategy_enterprise_check_trigger;
INSERT INTO pg_catalog.pg_dist_rebalance_strategy SELECT INSERT INTO pg_catalog.pg_dist_rebalance_strategy SELECT
name, name,
default_strategy, default_strategy,
@ -34,7 +33,6 @@ BEGIN
minimum_threshold, minimum_threshold,
improvement_threshold improvement_threshold
FROM public.pg_dist_rebalance_strategy; FROM public.pg_dist_rebalance_strategy;
ALTER TABLE pg_catalog.pg_dist_rebalance_strategy ENABLE TRIGGER pg_dist_rebalance_strategy_enterprise_check_trigger;
-- --
-- drop backup tables -- drop backup tables

View File

@ -23,7 +23,6 @@ BEGIN
INSERT INTO pg_catalog.pg_dist_authinfo SELECT * FROM public.pg_dist_authinfo; INSERT INTO pg_catalog.pg_dist_authinfo SELECT * FROM public.pg_dist_authinfo;
INSERT INTO pg_catalog.pg_dist_poolinfo SELECT * FROM public.pg_dist_poolinfo; INSERT INTO pg_catalog.pg_dist_poolinfo SELECT * FROM public.pg_dist_poolinfo;
ALTER TABLE pg_catalog.pg_dist_rebalance_strategy DISABLE TRIGGER pg_dist_rebalance_strategy_enterprise_check_trigger;
INSERT INTO pg_catalog.pg_dist_rebalance_strategy SELECT INSERT INTO pg_catalog.pg_dist_rebalance_strategy SELECT
name, name,
default_strategy, default_strategy,
@ -34,7 +33,6 @@ BEGIN
minimum_threshold, minimum_threshold,
improvement_threshold improvement_threshold
FROM public.pg_dist_rebalance_strategy; FROM public.pg_dist_rebalance_strategy;
ALTER TABLE pg_catalog.pg_dist_rebalance_strategy ENABLE TRIGGER pg_dist_rebalance_strategy_enterprise_check_trigger;
-- --
-- drop backup tables -- drop backup tables

View File

@ -568,6 +568,7 @@ SELECT * FROM print_extension_changes();
--------------------------------------------------------------------- ---------------------------------------------------------------------
function citus_add_rebalance_strategy(name,regproc,regproc,regproc,real,real) void | function citus_add_rebalance_strategy(name,regproc,regproc,regproc,real,real) void |
function citus_internal.columnar_ensure_objects_exist() void | function citus_internal.columnar_ensure_objects_exist() void |
function citus_internal.pg_dist_rebalance_strategy_enterprise_check() trigger |
function create_distributed_table(regclass,text,citus.distribution_type,text) void | function create_distributed_table(regclass,text,citus.distribution_type,text) void |
function get_rebalance_progress() TABLE(sessionid integer, table_name regclass, shardid bigint, shard_size bigint, sourcename text, sourceport integer, targetname text, targetport integer, progress bigint) | function get_rebalance_progress() TABLE(sessionid integer, table_name regclass, shardid bigint, shard_size bigint, sourcename text, sourceport integer, targetname text, targetport integer, progress bigint) |
function get_rebalance_table_shards_plan(regclass,real,integer,bigint[],boolean,name) TABLE(table_name regclass, shardid bigint, shard_size bigint, sourcename text, sourceport integer, targetname text, targetport integer) | function get_rebalance_table_shards_plan(regclass,real,integer,bigint[],boolean,name) TABLE(table_name regclass, shardid bigint, shard_size bigint, sourcename text, sourceport integer, targetname text, targetport integer) |
@ -579,7 +580,7 @@ SELECT * FROM print_extension_changes();
| function worker_partitioned_relation_size(regclass) bigint | function worker_partitioned_relation_size(regclass) bigint
| function worker_partitioned_relation_total_size(regclass) bigint | function worker_partitioned_relation_total_size(regclass) bigint
| function worker_partitioned_table_size(regclass) bigint | function worker_partitioned_table_size(regclass) bigint
(13 rows) (14 rows)
DROP TABLE prev_objects, extension_diff; DROP TABLE prev_objects, extension_diff;
-- show running version -- show running version

View File

@ -58,7 +58,6 @@ ORDER BY 1;
function citus_get_active_worker_nodes() function citus_get_active_worker_nodes()
function citus_internal.find_groupid_for_node(text,integer) function citus_internal.find_groupid_for_node(text,integer)
function citus_internal.pg_dist_node_trigger_func() function citus_internal.pg_dist_node_trigger_func()
function citus_internal.pg_dist_rebalance_strategy_enterprise_check()
function citus_internal.pg_dist_rebalance_strategy_trigger_func() function citus_internal.pg_dist_rebalance_strategy_trigger_func()
function citus_internal.pg_dist_shard_placement_trigger_func() function citus_internal.pg_dist_shard_placement_trigger_func()
function citus_internal.refresh_isolation_tester_prepared_statement() function citus_internal.refresh_isolation_tester_prepared_statement()
@ -246,5 +245,5 @@ ORDER BY 1;
view citus_worker_stat_activity view citus_worker_stat_activity
view pg_dist_shard_placement view pg_dist_shard_placement
view time_partitions view time_partitions
(230 rows) (229 rows)