From 4b064fa321ed779deac1efafe6588be450744247 Mon Sep 17 00:00:00 2001 From: Sameer Awasekar Date: Wed, 25 May 2022 17:14:05 +0530 Subject: [PATCH] change name of logical decoding plugin --- Makefile | 7 ++++--- .../distributed/operations/shard_split_replicatoin.c | 2 +- src/backend/distributed/shardsplit/Makefile | 2 +- .../regress/expected/split_shard_replication_setup.out | 6 +++--- src/test/regress/sql/split_shard_replication_setup.sql | 6 +++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index ce8c6bc0f..f11eb88c8 100644 --- a/Makefile +++ b/Makefile @@ -17,16 +17,17 @@ all: extension pg_send_cancellation # build columnar only columnar: $(MAKE) -C src/backend/columnar all -logical_decoding_plugin: +# 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-logical_decoding_plugin: logical_decoding_plugin +install-decoding_plugin_for_shard_split: decoding_plugin_for_shard_split $(MAKE) -C src/backend/distributed/shardsplit install -install-extension: extension install-columnar install-logical_decoding_plugin +install-extension: extension install-columnar install-decoding_plugin_for_shard_split $(MAKE) -C src/backend/distributed/ install install-headers: extension $(MKDIR_P) '$(DESTDIR)$(includedir_server)/distributed/' diff --git a/src/backend/distributed/operations/shard_split_replicatoin.c b/src/backend/distributed/operations/shard_split_replicatoin.c index 3d96c0468..4c179771c 100644 --- a/src/backend/distributed/operations/shard_split_replicatoin.c +++ b/src/backend/distributed/operations/shard_split_replicatoin.c @@ -86,7 +86,7 @@ static void SetupHashMapForShardInfo(); * * There is a 1-1 mapping between a target node and a replication slot as one replication * slot takes care of replicating changes for one node. - * The 'logical_decoding_plugin' consumes this information and routes the tuple + * The 'decoding_plugin_for_shard_split' consumes this information and routes the tuple * from the source shard to the appropriate destination shard that falls in the * respective range. */ diff --git a/src/backend/distributed/shardsplit/Makefile b/src/backend/distributed/shardsplit/Makefile index f0181816d..93ec8a0b2 100644 --- a/src/backend/distributed/shardsplit/Makefile +++ b/src/backend/distributed/shardsplit/Makefile @@ -16,7 +16,7 @@ ENSURE_SUBDIRS_EXIST := $(shell mkdir -p $(SUBDIRS)) $(patsubst $(citus_abs_srcdir)/%.c,%.o,$(foreach dir,$(SUBDIRS), $(sort $(wildcard $(citus_abs_srcdir)/$(dir)/*.c)))) OBJS += pgoutput.o -MODULE_big = logical_decoding_plugin +MODULE_big = decoding_plugin_for_shard_split PG_CPPFLAGS += -I$(libpq_srcdir) -I$(safestringlib_srcdir)/include diff --git a/src/test/regress/expected/split_shard_replication_setup.out b/src/test/regress/expected/split_shard_replication_setup.out index d51525fd6..3c4df005c 100644 --- a/src/test/regress/expected/split_shard_replication_setup.out +++ b/src/test/regress/expected/split_shard_replication_setup.out @@ -57,12 +57,12 @@ begin SELECT * into sharedMemoryId from SplitShardReplicationSetup(targetNode1, targetNode2); SELECT FORMAT('%s_%s', targetNode1, sharedMemoryId) into derivedSlotName; - SELECT slot_name into targetOneSlotName from pg_create_logical_replication_slot(derivedSlotName, 'logical_decoding_plugin'); + SELECT slot_name into targetOneSlotName from pg_create_logical_replication_slot(derivedSlotName, 'decoding_plugin_for_shard_split'); -- if new child shards are placed on different nodes, create one more replication slot if (targetNode1 != targetNode2) then SELECT FORMAT('%s_%s', targetNode2, sharedMemoryId) into derivedSlotName; - SELECT slot_name into targetTwoSlotName from pg_create_logical_replication_slot(derivedSlotName, 'logical_decoding_plugin'); + SELECT slot_name into targetTwoSlotName from pg_create_logical_replication_slot(derivedSlotName, 'decoding_plugin_for_shard_split'); INSERT INTO slotName_table values(targetTwoSlotName, targetNode2, 1); end if; @@ -102,7 +102,7 @@ $$ LANGUAGE plpgsql; -- ARRAY[1, 3 , 0 , 2147483647, 18 ] -- ] -- ); --- 5. Create Replication slot with 'logical_decoding_plugin' +-- 5. Create Replication slot with 'decoding_plugin_for_shard_split' -- 6. Setup Pub/Sub -- 7. Insert into table_to_split_1 at source worker1 -- 8. Expect the results in either table_to_split_2 or table_to_split_2 at worker2 diff --git a/src/test/regress/sql/split_shard_replication_setup.sql b/src/test/regress/sql/split_shard_replication_setup.sql index ab3c1b494..2fb3de983 100644 --- a/src/test/regress/sql/split_shard_replication_setup.sql +++ b/src/test/regress/sql/split_shard_replication_setup.sql @@ -43,12 +43,12 @@ begin SELECT * into sharedMemoryId from SplitShardReplicationSetup(targetNode1, targetNode2); SELECT FORMAT('%s_%s', targetNode1, sharedMemoryId) into derivedSlotName; - SELECT slot_name into targetOneSlotName from pg_create_logical_replication_slot(derivedSlotName, 'logical_decoding_plugin'); + SELECT slot_name into targetOneSlotName from pg_create_logical_replication_slot(derivedSlotName, 'decoding_plugin_for_shard_split'); -- if new child shards are placed on different nodes, create one more replication slot if (targetNode1 != targetNode2) then SELECT FORMAT('%s_%s', targetNode2, sharedMemoryId) into derivedSlotName; - SELECT slot_name into targetTwoSlotName from pg_create_logical_replication_slot(derivedSlotName, 'logical_decoding_plugin'); + SELECT slot_name into targetTwoSlotName from pg_create_logical_replication_slot(derivedSlotName, 'decoding_plugin_for_shard_split'); INSERT INTO slotName_table values(targetTwoSlotName, targetNode2, 1); end if; @@ -91,7 +91,7 @@ $$ LANGUAGE plpgsql; -- ARRAY[1, 3 , 0 , 2147483647, 18 ] -- ] -- ); --- 5. Create Replication slot with 'logical_decoding_plugin' +-- 5. Create Replication slot with 'decoding_plugin_for_shard_split' -- 6. Setup Pub/Sub -- 7. Insert into table_to_split_1 at source worker1 -- 8. Expect the results in either table_to_split_2 or table_to_split_2 at worker2