diff --git a/src/backend/distributed/Makefile b/src/backend/distributed/Makefile index fbaca79aa..e5fc623eb 100644 --- a/src/backend/distributed/Makefile +++ b/src/backend/distributed/Makefile @@ -7,7 +7,7 @@ MODULE_big = citus EXTENSION = citus EXTVERSIONS = 5.0 5.0-1 5.0-2 \ 5.1-1 5.1-2 5.1-3 5.1-4 5.1-5 5.1-6 5.1-7 5.1-8 \ - 5.2-1 + 5.2-1 5.3-1 # All citus--*.sql files in the source directory DATA = $(patsubst $(citus_abs_srcdir)/%.sql,%.sql,$(wildcard $(citus_abs_srcdir)/$(EXTENSION)--*--*.sql)) @@ -52,6 +52,8 @@ $(EXTENSION)--5.1-8.sql: $(EXTENSION)--5.1-7.sql $(EXTENSION)--5.1-7--5.1-8.sql cat $^ > $@ $(EXTENSION)--5.2-1.sql: $(EXTENSION)--5.1-8.sql $(EXTENSION)--5.1-8--5.2-1.sql cat $^ > $@ +$(EXTENSION)--5.3-1.sql: $(EXTENSION)--5.2-1.sql $(EXTENSION)--5.2-1--5.3-1.sql + cat $^ > $@ NO_PGXS = 1 diff --git a/src/backend/distributed/citus--5.2-1--5.3-1.sql b/src/backend/distributed/citus--5.2-1--5.3-1.sql index 6f03427f9..73facf447 100644 --- a/src/backend/distributed/citus--5.2-1--5.3-1.sql +++ b/src/backend/distributed/citus--5.2-1--5.3-1.sql @@ -10,7 +10,7 @@ CREATE TABLE citus.pg_dist_node( UNIQUE (nodename, nodeport) ); -CREATE SEQUENCE citus.pg_dist_gropuid_seq +CREATE SEQUENCE citus.pg_dist_groupid_seq MINVALUE 1 MAXVALUE 4294967296; @@ -19,7 +19,7 @@ CREATE SEQUENCE citus.pg_dist_node_nodeid_seq MAXVALUE 4294967296; ALTER TABLE citus.pg_dist_node SET SCHEMA pg_catalog; -ALTER SEQUENCE citus.pg_dist_gropuid_seq SET SCHEMA pg_catalog; +ALTER SEQUENCE citus.pg_dist_groupid_seq SET SCHEMA pg_catalog; ALTER SEQUENCE citus.pg_dist_node_nodeid_seq SET SCHEMA pg_catalog; CREATE FUNCTION master_dist_node_cache_invalidate() diff --git a/src/backend/distributed/citus.control b/src/backend/distributed/citus.control index a6881d90b..49040ed21 100644 --- a/src/backend/distributed/citus.control +++ b/src/backend/distributed/citus.control @@ -1,6 +1,6 @@ # Citus extension comment = 'Citus distributed database' -default_version = '5.2-1' +default_version = '5.3-1' module_pathname = '$libdir/citus' relocatable = false schema = pg_catalog diff --git a/src/backend/distributed/utils/node_metadata.c b/src/backend/distributed/utils/node_metadata.c index f2e5e295e..ba38cbd69 100644 --- a/src/backend/distributed/utils/node_metadata.c +++ b/src/backend/distributed/utils/node_metadata.c @@ -51,7 +51,8 @@ static List * ParseWorkerNodeFile(const char *workerNodeFilename); /* declarations for dynamic loading */ PG_FUNCTION_INFO_V1(cluster_add_node); -PG_FUNCTION_INFO_V1(cluster_read_worker_file); +PG_FUNCTION_INFO_V1(cluster_remove_node); +PG_FUNCTION_INFO_V1(cluster_initialize_node_metadata); PG_FUNCTION_INFO_V1(master_get_new_nodeid); PG_FUNCTION_INFO_V1(master_get_next_groupid); @@ -125,11 +126,23 @@ cluster_add_node(PG_FUNCTION_ARGS) } +Datum +cluster_remove_node(PG_FUNCTION_ARGS) +{ + text *nodeName = PG_GETARG_TEXT_P(0); + int32 nodePort = PG_GETARG_INT32(1); + + PG_RETURN_VOID(); +} + + /* */ Datum -cluster_read_worker_file(PG_FUNCTION_ARGS) +cluster_initialize_node_metadata(PG_FUNCTION_ARGS) { + PG_RETURN_BOOL(true); + /* text *filePath = PG_GETARG_TEXT_P(0); char *filePathCStr = text_to_cstring(filePath); @@ -147,6 +160,7 @@ cluster_read_worker_file(PG_FUNCTION_ARGS) } PG_RETURN_BOOL(true); + */ } diff --git a/src/test/regress/expected/multi_cluster_node.out b/src/test/regress/expected/multi_cluster_node.out index 0ba6a32d1..f02d30f0d 100644 --- a/src/test/regress/expected/multi_cluster_node.out +++ b/src/test/regress/expected/multi_cluster_node.out @@ -1,15 +1,15 @@ -- Tests functions related to cluster membership -- add the nodes to the cluster SELECT cluster_add_node('localhost', :worker_1_port); - cluster_add_node ---------------------------- - (1,p,t,1,localhost,57637) + cluster_add_node +----------------------- + (1,1,localhost,57637) (1 row) SELECT cluster_add_node('localhost', :worker_2_port); - cluster_add_node ---------------------------- - (2,p,t,2,localhost,57638) + cluster_add_node +----------------------- + (2,2,localhost,57638) (1 row) -- get the active nodes @@ -20,42 +20,11 @@ SELECT master_get_active_worker_nodes(); (localhost,57637) (2 rows) --- de-activate a node -SELECT cluster_deactivate_node('localhost', :worker_1_port); - cluster_deactivate_node -------------------------- - t -(1 row) - --- try to add the node again when it is de-activated -SELECT cluster_add_node('localhost', :worker_1_port); - cluster_add_node ---------------------------- - (1,p,f,1,localhost,57637) -(1 row) - --- get the active nodes again to see deactivation -SELECT master_get_active_worker_nodes(); - master_get_active_worker_nodes --------------------------------- - (localhost,57638) -(1 row) - --- we cannot de-activate a node that is already de-activated -SELECT cluster_deactivate_node('localhost', :worker_1_port); -ERROR: node is already deactivated --- activate it again -SELECT cluster_activate_node('localhost', :worker_1_port); - cluster_activate_node ------------------------ - t -(1 row) - -- try to add the node again when it is activated SELECT cluster_add_node('localhost', :worker_1_port); - cluster_add_node ---------------------------- - (1,p,t,1,localhost,57637) + cluster_add_node +----------------------- + (1,1,localhost,57637) (1 row) -- get the active nodes diff --git a/src/test/regress/expected/multi_drop_extension.out b/src/test/regress/expected/multi_drop_extension.out index 80003a8bb..47c355db1 100644 --- a/src/test/regress/expected/multi_drop_extension.out +++ b/src/test/regress/expected/multi_drop_extension.out @@ -21,15 +21,15 @@ RESET client_min_messages; CREATE EXTENSION citus; -- re-add the nodes to the cluster SELECT cluster_add_node('localhost', :worker_1_port); - cluster_add_node ---------------------------- - (1,p,t,1,localhost,57637) + cluster_add_node +----------------------- + (1,1,localhost,57637) (1 row) SELECT cluster_add_node('localhost', :worker_2_port); - cluster_add_node ---------------------------- - (2,p,t,2,localhost,57638) + cluster_add_node +----------------------- + (2,2,localhost,57638) (1 row) -- verify that a table can be created after the extension has been dropped and recreated diff --git a/src/test/regress/expected/multi_router_planner.out b/src/test/regress/expected/multi_router_planner.out index e6053d972..25034bbf7 100644 --- a/src/test/regress/expected/multi_router_planner.out +++ b/src/test/regress/expected/multi_router_planner.out @@ -1534,7 +1534,7 @@ DROP MATERIALIZED VIEW mv_articles_hash; DEBUG: drop auto-cascades to type mv_articles_hash DEBUG: drop auto-cascades to type mv_articles_hash[] DEBUG: drop auto-cascades to rule _RETURN on materialized view mv_articles_hash -DEBUG: EventTriggerInvoke 16727 +DEBUG: EventTriggerInvoke 16763 CREATE MATERIALIZED VIEW mv_articles_hash_error AS SELECT * FROM articles_hash WHERE author_id in (1,2); NOTICE: cannot use shard pruning with ANY/ALL (array expression) diff --git a/src/test/regress/expected/multi_table_ddl.out b/src/test/regress/expected/multi_table_ddl.out index 054dc04c2..85cbdbaf6 100644 --- a/src/test/regress/expected/multi_table_ddl.out +++ b/src/test/regress/expected/multi_table_ddl.out @@ -67,15 +67,15 @@ DROP EXTENSION citus; CREATE EXTENSION citus; -- re-add the nodes to the cluster SELECT cluster_add_node('localhost', :worker_1_port); - cluster_add_node ---------------------------- - (1,p,t,1,localhost,57637) + cluster_add_node +----------------------- + (1,1,localhost,57637) (1 row) SELECT cluster_add_node('localhost', :worker_2_port); - cluster_add_node ---------------------------- - (2,p,t,2,localhost,57638) + cluster_add_node +----------------------- + (2,2,localhost,57638) (1 row) -- create a table with a SERIAL column diff --git a/src/test/regress/sql/multi_cluster_node.sql b/src/test/regress/sql/multi_cluster_node.sql index 08eae68ed..cbb4c8e05 100644 --- a/src/test/regress/sql/multi_cluster_node.sql +++ b/src/test/regress/sql/multi_cluster_node.sql @@ -7,23 +7,8 @@ SELECT cluster_add_node('localhost', :worker_2_port); -- get the active nodes SELECT master_get_active_worker_nodes(); --- de-activate a node -SELECT cluster_deactivate_node('localhost', :worker_1_port); - --- try to add the node again when it is de-activated -SELECT cluster_add_node('localhost', :worker_1_port); - --- get the active nodes again to see deactivation -SELECT master_get_active_worker_nodes(); - --- we cannot de-activate a node that is already de-activated -SELECT cluster_deactivate_node('localhost', :worker_1_port); - --- activate it again -SELECT cluster_activate_node('localhost', :worker_1_port); - -- try to add the node again when it is activated SELECT cluster_add_node('localhost', :worker_1_port); -- get the active nodes -SELECT master_get_active_worker_nodes(); \ No newline at end of file +SELECT master_get_active_worker_nodes();