diff --git a/Makefile b/Makefile index 42718a966..12b26cbbe 100644 --- a/Makefile +++ b/Makefile @@ -17,17 +17,12 @@ all: extension pg_send_cancellation # build columnar only columnar: $(MAKE) -C src/backend/columnar all -# build logical decoding plugin for shard split -decoding_plugin_for_shard_split: - $(MAKE) -C src/backend/distributed/shardsplit all # build extension extension: $(citus_top_builddir)/src/include/citus_version.h columnar $(MAKE) -C src/backend/distributed/ all install-columnar: columnar $(MAKE) -C src/backend/columnar install -install-decoding_plugin_for_shard_split: decoding_plugin_for_shard_split - $(MAKE) -C src/backend/distributed/shardsplit install -install-extension: extension install-columnar install-decoding_plugin_for_shard_split +install-extension: extension install-columnar $(MAKE) -C src/backend/distributed/ install install-headers: extension $(MKDIR_P) '$(DESTDIR)$(includedir_server)/distributed/' @@ -48,7 +43,6 @@ install-downgrades: install-all: install-headers install-pg_send_cancellation $(MAKE) -C src/backend/columnar/ install-all $(MAKE) -C src/backend/distributed/ install-all - $(MAKE) -C src/backend/distributed/shardsplit install-all # build citus_send_cancellation binary pg_send_cancellation: diff --git a/src/backend/distributed/shardsplit/Makefile b/src/backend/distributed/shardsplit/Makefile deleted file mode 100644 index 2c36d6ad7..000000000 --- a/src/backend/distributed/shardsplit/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#------------------------------------------------------------------------- -# -# Makefile-- -# Makefile for src/backend/replication/pgoutput -# -# IDENTIFICATION -# src/backend/replication/pgoutput -# -#------------------------------------------------------------------------- -citus_top_builddir = ../../../.. -safestringlib_srcdir = $(citus_abs_top_srcdir)/vendor/safestringlib -SUBDIRS = . safeclib -SUBDIRS += -ENSURE_SUBDIRS_EXIST := $(shell mkdir -p $(SUBDIRS)) -OBJS += shardsplit_decoder.o - -MODULE_big = decoding_plugin_for_shard_split - -PG_CPPFLAGS += -I$(libpq_srcdir) -I$(safestringlib_srcdir)/include - -include $(citus_top_builddir)/Makefile.global - -.PHONY: install-all -install-all: install diff --git a/src/backend/distributed/sql/udfs/split_shard_replication_setup/11.0-2.sql b/src/backend/distributed/sql/udfs/split_shard_replication_setup/11.0-2.sql index 4a3b4a223..5021a2baf 100644 --- a/src/backend/distributed/sql/udfs/split_shard_replication_setup/11.0-2.sql +++ b/src/backend/distributed/sql/udfs/split_shard_replication_setup/11.0-2.sql @@ -15,4 +15,6 @@ RETURNS void LANGUAGE C STRICT AS 'MODULE_PATHNAME', $$worker_split_shard_replication_setup$$; COMMENT ON FUNCTION pg_catalog.worker_split_shard_replication_setup(splitShardInfo citus.split_shard_info[]) - IS 'Replication setup for splitting a shard' + IS 'Replication setup for splitting a shard'; + +REVOKE ALL ON FUNCTION pg_catalog.worker_split_shard_replication_setup(citus.split_shard_info[]) FROM PUBLIC; diff --git a/src/backend/distributed/sql/udfs/split_shard_replication_setup/latest.sql b/src/backend/distributed/sql/udfs/split_shard_replication_setup/latest.sql index 4a3b4a223..5021a2baf 100644 --- a/src/backend/distributed/sql/udfs/split_shard_replication_setup/latest.sql +++ b/src/backend/distributed/sql/udfs/split_shard_replication_setup/latest.sql @@ -15,4 +15,6 @@ RETURNS void LANGUAGE C STRICT AS 'MODULE_PATHNAME', $$worker_split_shard_replication_setup$$; COMMENT ON FUNCTION pg_catalog.worker_split_shard_replication_setup(splitShardInfo citus.split_shard_info[]) - IS 'Replication setup for splitting a shard' + IS 'Replication setup for splitting a shard'; + +REVOKE ALL ON FUNCTION pg_catalog.worker_split_shard_replication_setup(citus.split_shard_info[]) FROM PUBLIC; diff --git a/src/test/regress/expected/split_shard_replication_colocated_setup.out b/src/test/regress/expected/split_shard_replication_colocated_setup.out index 173628896..65688fa74 100644 --- a/src/test/regress/expected/split_shard_replication_colocated_setup.out +++ b/src/test/regress/expected/split_shard_replication_colocated_setup.out @@ -73,8 +73,8 @@ SELECT worker_split_shard_replication_setup(ARRAY[ WARNING: As a part of split shard workflow,unexpectedly found a valid shared memory handle while storing a new one. SELECT relowner AS table_owner_one FROM pg_class WHERE relname='table_first' \gset SELECT relowner AS table_owner_two FROM pg_class WHERE relname='table_second' \gset -SELECT slot_name AS slot_for_first_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_one), 'decoding_plugin_for_shard_split') \gset -SELECT slot_name AS slot_for_second_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_two), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name AS slot_for_first_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_one), 'citus') \gset +SELECT slot_name AS slot_for_second_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_two), 'citus') \gset SELECT pg_sleep(5); pg_sleep --------------------------------------------------------------------- diff --git a/src/test/regress/expected/split_shard_replication_setup.out b/src/test/regress/expected/split_shard_replication_setup.out index 7f34da9cb..1b8b2cf07 100644 --- a/src/test/regress/expected/split_shard_replication_setup.out +++ b/src/test/regress/expected/split_shard_replication_setup.out @@ -48,7 +48,7 @@ SELECT worker_split_shard_replication_setup(ARRAY[ ROW(1, 2, '-2147483648', '-1', :worker_2_node)::citus.split_shard_info, ROW(1, 3, '0', '2147483647', :worker_2_node)::citus.split_shard_info ]) AS shared_memory_id \gset -SELECT slot_name FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'citus') \gset -- Create subscription at worker2 with copy_data to 'false' and derived replication slot name \c - - - :worker_2_port SET search_path TO split_shard_replication_setup_schema; diff --git a/src/test/regress/expected/split_shard_replication_setup_local.out b/src/test/regress/expected/split_shard_replication_setup_local.out index ea8e1fcd8..bfdade34a 100644 --- a/src/test/regress/expected/split_shard_replication_setup_local.out +++ b/src/test/regress/expected/split_shard_replication_setup_local.out @@ -14,7 +14,7 @@ SELECT worker_split_shard_replication_setup(ARRAY[ ROW(1, 2, '-2147483648', '-1', :worker_1_node)::citus.split_shard_info, ROW(1, 3, '0', '2147483647', :worker_1_node)::citus.split_shard_info ]) AS shared_memory_id \gset -SELECT slot_name AS local_slot FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name AS local_slot FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'citus') \gset -- Create subscription at worker1 with copy_data to 'false' a BEGIN; CREATE SUBSCRIPTION local_subscription diff --git a/src/test/regress/expected/split_shard_replication_setup_remote_local.out b/src/test/regress/expected/split_shard_replication_setup_remote_local.out index c08efc85d..0920afa29 100644 --- a/src/test/regress/expected/split_shard_replication_setup_remote_local.out +++ b/src/test/regress/expected/split_shard_replication_setup_remote_local.out @@ -13,8 +13,8 @@ SELECT worker_split_shard_replication_setup(ARRAY[ ROW(1, 3, '0', '2147483647', :worker_2_node)::citus.split_shard_info ]) AS shared_memory_id \gset WARNING: As a part of split shard workflow,unexpectedly found a valid shared memory handle while storing a new one. -SELECT slot_name AS slot_for_worker1 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'decoding_plugin_for_shard_split') \gset -SELECT slot_name AS slot_for_worker2 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name AS slot_for_worker1 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'citus') \gset +SELECT slot_name AS slot_for_worker2 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'citus') \gset -- Create subscription at worker1 with copy_data to 'false' and 'slot_for_worker1' CREATE SUBSCRIPTION sub_worker1 CONNECTION 'host=localhost port=xxxxx user=postgres dbname=regression' diff --git a/src/test/regress/sql/split_shard_replication_colocated_setup.sql b/src/test/regress/sql/split_shard_replication_colocated_setup.sql index 6b5111e08..0f973a666 100644 --- a/src/test/regress/sql/split_shard_replication_colocated_setup.sql +++ b/src/test/regress/sql/split_shard_replication_colocated_setup.sql @@ -76,9 +76,9 @@ SELECT worker_split_shard_replication_setup(ARRAY[ SELECT relowner AS table_owner_one FROM pg_class WHERE relname='table_first' \gset SELECT relowner AS table_owner_two FROM pg_class WHERE relname='table_second' \gset -SELECT slot_name AS slot_for_first_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_one), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name AS slot_for_first_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_one), 'citus') \gset -SELECT slot_name AS slot_for_second_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_two), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name AS slot_for_second_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_two), 'citus') \gset SELECT pg_sleep(5); diff --git a/src/test/regress/sql/split_shard_replication_setup.sql b/src/test/regress/sql/split_shard_replication_setup.sql index 35b33271c..446c451a8 100644 --- a/src/test/regress/sql/split_shard_replication_setup.sql +++ b/src/test/regress/sql/split_shard_replication_setup.sql @@ -51,7 +51,7 @@ SELECT worker_split_shard_replication_setup(ARRAY[ ROW(1, 3, '0', '2147483647', :worker_2_node)::citus.split_shard_info ]) AS shared_memory_id \gset -SELECT slot_name FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'citus') \gset -- Create subscription at worker2 with copy_data to 'false' and derived replication slot name \c - - - :worker_2_port diff --git a/src/test/regress/sql/split_shard_replication_setup_local.sql b/src/test/regress/sql/split_shard_replication_setup_local.sql index 1a269dc52..cba85acaf 100644 --- a/src/test/regress/sql/split_shard_replication_setup_local.sql +++ b/src/test/regress/sql/split_shard_replication_setup_local.sql @@ -18,7 +18,7 @@ SELECT worker_split_shard_replication_setup(ARRAY[ ROW(1, 3, '0', '2147483647', :worker_1_node)::citus.split_shard_info ]) AS shared_memory_id \gset -SELECT slot_name AS local_slot FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name AS local_slot FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'citus') \gset -- Create subscription at worker1 with copy_data to 'false' a BEGIN; diff --git a/src/test/regress/sql/split_shard_replication_setup_remote_local.sql b/src/test/regress/sql/split_shard_replication_setup_remote_local.sql index cceb972a7..7e6a72bcd 100644 --- a/src/test/regress/sql/split_shard_replication_setup_remote_local.sql +++ b/src/test/regress/sql/split_shard_replication_setup_remote_local.sql @@ -16,8 +16,8 @@ SELECT worker_split_shard_replication_setup(ARRAY[ ROW(1, 3, '0', '2147483647', :worker_2_node)::citus.split_shard_info ]) AS shared_memory_id \gset -SELECT slot_name AS slot_for_worker1 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'decoding_plugin_for_shard_split') \gset -SELECT slot_name AS slot_for_worker2 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'decoding_plugin_for_shard_split') \gset +SELECT slot_name AS slot_for_worker1 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'citus') \gset +SELECT slot_name AS slot_for_worker2 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'citus') \gset -- Create subscription at worker1 with copy_data to 'false' and 'slot_for_worker1' CREATE SUBSCRIPTION sub_worker1