From fcd418214e2943b616411ea78d3ef828b9eb8036 Mon Sep 17 00:00:00 2001 From: Brian Cloutier Date: Fri, 23 Sep 2016 16:36:22 +0300 Subject: [PATCH] cluster_ -> master_ --- .../distributed/citus--5.2-1--5.2-2.sql | 26 +++++++++---------- src/backend/distributed/utils/node_metadata.c | 18 ++++++------- .../regress/expected/multi_cluster_node.out | 12 ++++----- .../regress/expected/multi_drop_extension.out | 8 +++--- src/test/regress/expected/multi_table_ddl.out | 8 +++--- src/test/regress/sql/multi_cluster_node.sql | 6 ++--- src/test/regress/sql/multi_drop_extension.sql | 4 +-- src/test/regress/sql/multi_table_ddl.sql | 4 +-- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/backend/distributed/citus--5.2-1--5.2-2.sql b/src/backend/distributed/citus--5.2-1--5.2-2.sql index 65fcca413..91e8ade49 100644 --- a/src/backend/distributed/citus--5.2-1--5.2-2.sql +++ b/src/backend/distributed/citus--5.2-1--5.2-2.sql @@ -33,30 +33,30 @@ CREATE TRIGGER dist_node_cache_invalidate ON pg_catalog.pg_dist_node FOR EACH ROW EXECUTE PROCEDURE master_dist_node_cache_invalidate(); -CREATE FUNCTION cluster_add_node(nodename text, - nodeport integer, - groupid integer DEFAULT 0) +CREATE FUNCTION master_add_node(nodename text, + nodeport integer, + groupid integer DEFAULT 0) RETURNS record LANGUAGE C STRICT - AS 'MODULE_PATHNAME', $$cluster_add_node$$; -COMMENT ON FUNCTION cluster_add_node(nodename text, - nodeport integer, - groupid integer) + AS 'MODULE_PATHNAME', $$master_add_node$$; +COMMENT ON FUNCTION master_add_node(nodename text, + nodeport integer, + groupid integer) IS 'add node to the cluster'; -CREATE FUNCTION cluster_remove_node(nodename text, nodeport integer) +CREATE FUNCTION master_remove_node(nodename text, nodeport integer) RETURNS void LANGUAGE C STRICT - AS 'MODULE_PATHNAME', $$cluster_remove_node$$; -COMMENT ON FUNCTION cluster_remove_node(nodename text, nodeport integer) + AS 'MODULE_PATHNAME', $$master_remove_node$$; +COMMENT ON FUNCTION master_remove_node(nodename text, nodeport integer) IS 'remove node from the cluster'; /* this only needs to run once, now. */ -CREATE FUNCTION cluster_initialize_node_metadata() +CREATE FUNCTION master_initialize_node_metadata() RETURNS BOOL LANGUAGE C STRICT - AS 'MODULE_PATHNAME', $$cluster_initialize_node_metadata$$; + AS 'MODULE_PATHNAME', $$master_initialize_node_metadata$$; -SELECT cluster_initialize_node_metadata(); +SELECT master_initialize_node_metadata(); RESET search_path; diff --git a/src/backend/distributed/utils/node_metadata.c b/src/backend/distributed/utils/node_metadata.c index 5efa9c1e1..813acd651 100644 --- a/src/backend/distributed/utils/node_metadata.c +++ b/src/backend/distributed/utils/node_metadata.c @@ -49,15 +49,15 @@ static uint64 GetNodeCountInGroup(uint32 groupId); static List * ParseWorkerNodeFile(const char *workerNodeFilename); /* declarations for dynamic loading */ -PG_FUNCTION_INFO_V1(cluster_add_node); -PG_FUNCTION_INFO_V1(cluster_remove_node); -PG_FUNCTION_INFO_V1(cluster_initialize_node_metadata); +PG_FUNCTION_INFO_V1(master_add_node); +PG_FUNCTION_INFO_V1(master_remove_node); +PG_FUNCTION_INFO_V1(master_initialize_node_metadata); PG_FUNCTION_INFO_V1(master_get_new_nodeid); PG_FUNCTION_INFO_V1(master_get_next_groupid); /* - * cluster_add_node function adds a new node to the cluster. If the node already + * master_add_node function adds a new node to the cluster. If the node already * exists, the function returns with the information about the node. If not, the * following prodecure is followed while adding a node. * If the groupId is not explicitly given by the user, the function picks the @@ -65,7 +65,7 @@ PG_FUNCTION_INFO_V1(master_get_next_groupid); * new node is inserted into the local pg_dist_node. */ Datum -cluster_add_node(PG_FUNCTION_ARGS) +master_add_node(PG_FUNCTION_ARGS) { text *nodeName = PG_GETARG_TEXT_P(0); int32 nodePort = PG_GETARG_INT32(1); @@ -126,7 +126,7 @@ cluster_add_node(PG_FUNCTION_ARGS) Datum -cluster_remove_node(PG_FUNCTION_ARGS) +master_remove_node(PG_FUNCTION_ARGS) { text *nodeName = PG_GETARG_TEXT_P(0); int32 nodePort = PG_GETARG_INT32(1); @@ -145,12 +145,12 @@ cluster_remove_node(PG_FUNCTION_ARGS) /* - * cluster_initialize_node_metadata is run once, when upgrading citus. It injests the + * master_initialize_node_metadata is run once, when upgrading citus. It injests the * existing pg_worker_list.conf into pg_dist_node, then adds a header to the file stating * that it's no longer used. */ Datum -cluster_initialize_node_metadata(PG_FUNCTION_ARGS) +master_initialize_node_metadata(PG_FUNCTION_ARGS) { ListCell *workerNodeCell = NULL; List *workerNodes = ParseWorkerNodeFile("pg_worker_list.conf"); @@ -160,7 +160,7 @@ cluster_initialize_node_metadata(PG_FUNCTION_ARGS) WorkerNode *workerNode = (WorkerNode *) lfirst(workerNodeCell); Datum workerNameDatum = PointerGetDatum(cstring_to_text(workerNode->workerName)); - DirectFunctionCall3(cluster_add_node, workerNameDatum, + DirectFunctionCall3(master_add_node, workerNameDatum, UInt32GetDatum(workerNode->workerPort), PointerGetDatum(NULL)); } diff --git a/src/test/regress/expected/multi_cluster_node.out b/src/test/regress/expected/multi_cluster_node.out index f02d30f0d..15d9d0118 100644 --- a/src/test/regress/expected/multi_cluster_node.out +++ b/src/test/regress/expected/multi_cluster_node.out @@ -1,13 +1,13 @@ -- Tests functions related to cluster membership -- add the nodes to the cluster -SELECT cluster_add_node('localhost', :worker_1_port); - cluster_add_node +SELECT master_add_node('localhost', :worker_1_port); + master_add_node ----------------------- (1,1,localhost,57637) (1 row) -SELECT cluster_add_node('localhost', :worker_2_port); - cluster_add_node +SELECT master_add_node('localhost', :worker_2_port); + master_add_node ----------------------- (2,2,localhost,57638) (1 row) @@ -21,8 +21,8 @@ SELECT master_get_active_worker_nodes(); (2 rows) -- try to add the node again when it is activated -SELECT cluster_add_node('localhost', :worker_1_port); - cluster_add_node +SELECT master_add_node('localhost', :worker_1_port); + master_add_node ----------------------- (1,1,localhost,57637) (1 row) diff --git a/src/test/regress/expected/multi_drop_extension.out b/src/test/regress/expected/multi_drop_extension.out index 47c355db1..b00b22b2a 100644 --- a/src/test/regress/expected/multi_drop_extension.out +++ b/src/test/regress/expected/multi_drop_extension.out @@ -20,14 +20,14 @@ DROP EXTENSION citus CASCADE; 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 +SELECT master_add_node('localhost', :worker_1_port); + master_add_node ----------------------- (1,1,localhost,57637) (1 row) -SELECT cluster_add_node('localhost', :worker_2_port); - cluster_add_node +SELECT master_add_node('localhost', :worker_2_port); + master_add_node ----------------------- (2,2,localhost,57638) (1 row) diff --git a/src/test/regress/expected/multi_table_ddl.out b/src/test/regress/expected/multi_table_ddl.out index 85cbdbaf6..45efdfef9 100644 --- a/src/test/regress/expected/multi_table_ddl.out +++ b/src/test/regress/expected/multi_table_ddl.out @@ -66,14 +66,14 @@ SELECT * FROM pg_dist_shard_placement; DROP EXTENSION citus; CREATE EXTENSION citus; -- re-add the nodes to the cluster -SELECT cluster_add_node('localhost', :worker_1_port); - cluster_add_node +SELECT master_add_node('localhost', :worker_1_port); + master_add_node ----------------------- (1,1,localhost,57637) (1 row) -SELECT cluster_add_node('localhost', :worker_2_port); - cluster_add_node +SELECT master_add_node('localhost', :worker_2_port); + master_add_node ----------------------- (2,2,localhost,57638) (1 row) diff --git a/src/test/regress/sql/multi_cluster_node.sql b/src/test/regress/sql/multi_cluster_node.sql index cbb4c8e05..f2ae7222d 100644 --- a/src/test/regress/sql/multi_cluster_node.sql +++ b/src/test/regress/sql/multi_cluster_node.sql @@ -1,14 +1,14 @@ -- Tests functions related to cluster membership -- add the nodes to the cluster -SELECT cluster_add_node('localhost', :worker_1_port); -SELECT cluster_add_node('localhost', :worker_2_port); +SELECT master_add_node('localhost', :worker_1_port); +SELECT master_add_node('localhost', :worker_2_port); -- get the active nodes SELECT master_get_active_worker_nodes(); -- try to add the node again when it is activated -SELECT cluster_add_node('localhost', :worker_1_port); +SELECT master_add_node('localhost', :worker_1_port); -- get the active nodes SELECT master_get_active_worker_nodes(); diff --git a/src/test/regress/sql/multi_drop_extension.sql b/src/test/regress/sql/multi_drop_extension.sql index 2fa957357..9a78ed609 100644 --- a/src/test/regress/sql/multi_drop_extension.sql +++ b/src/test/regress/sql/multi_drop_extension.sql @@ -22,8 +22,8 @@ RESET client_min_messages; CREATE EXTENSION citus; -- re-add the nodes to the cluster -SELECT cluster_add_node('localhost', :worker_1_port); -SELECT cluster_add_node('localhost', :worker_2_port); +SELECT master_add_node('localhost', :worker_1_port); +SELECT master_add_node('localhost', :worker_2_port); -- verify that a table can be created after the extension has been dropped and recreated CREATE TABLE testtableddl(somecol int, distributecol text NOT NULL); diff --git a/src/test/regress/sql/multi_table_ddl.sql b/src/test/regress/sql/multi_table_ddl.sql index 707e21657..8cb2ddbf3 100644 --- a/src/test/regress/sql/multi_table_ddl.sql +++ b/src/test/regress/sql/multi_table_ddl.sql @@ -46,8 +46,8 @@ DROP EXTENSION citus; CREATE EXTENSION citus; -- re-add the nodes to the cluster -SELECT cluster_add_node('localhost', :worker_1_port); -SELECT cluster_add_node('localhost', :worker_2_port); +SELECT master_add_node('localhost', :worker_1_port); +SELECT master_add_node('localhost', :worker_2_port); -- create a table with a SERIAL column CREATE TABLE testserialtable(id serial, group_id integer);