diff --git a/src/backend/distributed/commands/create_distributed_table.c b/src/backend/distributed/commands/create_distributed_table.c index 74d71c372..da09bbbf5 100644 --- a/src/backend/distributed/commands/create_distributed_table.c +++ b/src/backend/distributed/commands/create_distributed_table.c @@ -106,7 +106,7 @@ master_create_distributed_table(PG_FUNCTION_ARGS) char *distributionColumnName = text_to_cstring(distributionColumnText); char distributionMethod = LookupDistributionMethod(distributionMethodOid); - EnsureSchemaNode(); + EnsureCoordinator(); ConvertToDistributedTable(distributedRelationId, distributionColumnName, distributionMethod, INVALID_COLOCATION_ID); @@ -132,7 +132,7 @@ create_distributed_table(PG_FUNCTION_ARGS) text *colocateWithTableNameText = NULL; char *colocateWithTableName = NULL; - EnsureSchemaNode(); + EnsureCoordinator(); /* guard against a binary update without a function update */ if (PG_NARGS() >= 4) @@ -213,7 +213,7 @@ CreateReferenceTable(Oid relationId) int replicationFactor = list_length(workerNodeList); char *distributionColumnName = NULL; - EnsureSchemaNode(); + EnsureCoordinator(); /* if there are no workers, error out */ if (replicationFactor == 0) diff --git a/src/backend/distributed/commands/drop_distributed_table.c b/src/backend/distributed/commands/drop_distributed_table.c index ba71ed719..76b29f1c8 100644 --- a/src/backend/distributed/commands/drop_distributed_table.c +++ b/src/backend/distributed/commands/drop_distributed_table.c @@ -38,7 +38,7 @@ master_drop_distributed_table_metadata(PG_FUNCTION_ARGS) char *schemaName = text_to_cstring(schemaNameText); char *tableName = text_to_cstring(tableNameText); - EnsureSchemaNode(); + EnsureCoordinator(); CheckTableSchemaNameForDrop(relationId, &schemaName, &tableName); diff --git a/src/backend/distributed/commands/multi_copy.c b/src/backend/distributed/commands/multi_copy.c index a6e0c6e9f..71ab02d35 100644 --- a/src/backend/distributed/commands/multi_copy.c +++ b/src/backend/distributed/commands/multi_copy.c @@ -326,7 +326,7 @@ CopyToExistingShards(CopyStmt *copyStatement, char *completionTag) /* we don't support copy to reference tables from workers */ if (partitionMethod == DISTRIBUTE_BY_NONE) { - EnsureSchemaNode(); + EnsureCoordinator(); } /* load the list of shards and verify that we have shards to copy into */ diff --git a/src/backend/distributed/executor/multi_utility.c b/src/backend/distributed/executor/multi_utility.c index e324c7e13..80f844059 100644 --- a/src/backend/distributed/executor/multi_utility.c +++ b/src/backend/distributed/executor/multi_utility.c @@ -170,7 +170,7 @@ multi_ProcessUtility(Node *parsetree, DestReceiver *dest, char *completionTag) { - bool schemaNode = SchemaNode(); + bool isCoordinator = IsCoordinator(); bool commandMustRunAsOwner = false; Oid savedUserId = InvalidOid; int savedSecurityContext = 0; @@ -228,7 +228,7 @@ multi_ProcessUtility(Node *parsetree, /* * DDL commands are propagated to workers only if EnableDDLPropagation is - * set to true and the current node is the schema node + * set to true and the current node is the coordinator */ if (EnableDDLPropagation) { @@ -296,7 +296,7 @@ multi_ProcessUtility(Node *parsetree, "move all tables."))); } } - else if (!schemaNode) + else if (!isCoordinator) { if (IsA(parsetree, AlterTableStmt)) { @@ -304,7 +304,7 @@ multi_ProcessUtility(Node *parsetree, if (alterTableStmt->relkind == OBJECT_TABLE) { /* - * When the schema node issues an ALTER TABLE ... ADD FOREIGN KEY + * When the coordinator issues an ALTER TABLE ... ADD FOREIGN KEY * command, the validation step should be skipped on the distributed * table of the worker. Therefore, we check whether the given ALTER * TABLE statement is a FOREIGN KEY constraint and if so disable the @@ -1975,7 +1975,7 @@ ExecuteDistributedDDLCommand(Oid relationId, const char *ddlCommandString, "modifications"))); } - EnsureSchemaNode(); + EnsureCoordinator(); ShowNoticeIfNotUsing2PC(); if (shouldSyncMetadata) @@ -2017,7 +2017,7 @@ ExecuteDistributedForeignKeyCommand(Oid leftRelationId, Oid rightRelationId, "modifications"))); } - EnsureSchemaNode(); + EnsureCoordinator(); ShowNoticeIfNotUsing2PC(); /* diff --git a/src/backend/distributed/master/master_create_shards.c b/src/backend/distributed/master/master_create_shards.c index 6d311d256..7c5a21011 100644 --- a/src/backend/distributed/master/master_create_shards.c +++ b/src/backend/distributed/master/master_create_shards.c @@ -67,7 +67,7 @@ master_create_worker_shards(PG_FUNCTION_ARGS) Oid distributedTableId = ResolveRelationId(tableNameText); - EnsureSchemaNode(); + EnsureCoordinator(); CreateShardsWithRoundRobinPolicy(distributedTableId, shardCount, replicationFactor); diff --git a/src/backend/distributed/master/master_delete_protocol.c b/src/backend/distributed/master/master_delete_protocol.c index ad793a128..a419130d7 100644 --- a/src/backend/distributed/master/master_delete_protocol.c +++ b/src/backend/distributed/master/master_delete_protocol.c @@ -111,7 +111,7 @@ master_apply_delete_command(PG_FUNCTION_ARGS) char partitionMethod = 0; bool failOK = false; - EnsureSchemaNode(); + EnsureCoordinator(); queryTreeNode = ParseTreeNode(queryString); if (!IsA(queryTreeNode, DeleteStmt)) @@ -208,7 +208,7 @@ master_drop_all_shards(PG_FUNCTION_ARGS) char *schemaName = text_to_cstring(schemaNameText); char *relationName = text_to_cstring(relationNameText); - EnsureSchemaNode(); + EnsureCoordinator(); CheckTableSchemaNameForDrop(relationId, &schemaName, &relationName); @@ -242,7 +242,7 @@ master_drop_sequences(PG_FUNCTION_ARGS) PG_RETURN_VOID(); } - EnsureSchemaNode(); + EnsureCoordinator(); /* iterate over sequence names to build single command to DROP them all */ sequenceIterator = array_create_iterator(sequenceNamesArray, 0, NULL); diff --git a/src/backend/distributed/master/master_modify_multiple_shards.c b/src/backend/distributed/master/master_modify_multiple_shards.c index b65710968..022bbe6e1 100644 --- a/src/backend/distributed/master/master_modify_multiple_shards.c +++ b/src/backend/distributed/master/master_modify_multiple_shards.c @@ -86,7 +86,7 @@ master_modify_multiple_shards(PG_FUNCTION_ARGS) List *taskList = NIL; int32 affectedTupleCount = 0; - EnsureSchemaNode(); + EnsureCoordinator(); queryTreeNode = ParseTreeNode(queryString); if (IsA(queryTreeNode, DeleteStmt)) diff --git a/src/backend/distributed/master/master_node_protocol.c b/src/backend/distributed/master/master_node_protocol.c index 915ac3dbc..1b3623e70 100644 --- a/src/backend/distributed/master/master_node_protocol.c +++ b/src/backend/distributed/master/master_node_protocol.c @@ -264,7 +264,7 @@ master_get_new_shardid(PG_FUNCTION_ARGS) uint64 shardId = 0; Datum shardIdDatum = 0; - EnsureSchemaNode(); + EnsureCoordinator(); shardId = GetNextShardId(); shardIdDatum = Int64GetDatum(shardId); @@ -321,7 +321,7 @@ master_get_new_placementid(PG_FUNCTION_ARGS) uint64 placementId = 0; Datum placementIdDatum = 0; - EnsureSchemaNode(); + EnsureCoordinator(); placementId = GetNextPlacementId(); placementIdDatum = Int64GetDatum(placementId); @@ -876,11 +876,11 @@ ShardStorageType(Oid relationId) /* - * SchemaNode function returns true if this node is identified as the + * IsCoordinator function returns true if this node is identified as the * schema/coordinator/master node of the cluster. */ bool -SchemaNode(void) +IsCoordinator(void) { return (GetLocalGroupId() == 0); } diff --git a/src/backend/distributed/master/master_repair_shards.c b/src/backend/distributed/master/master_repair_shards.c index 22f75cb73..1fb03cae8 100644 --- a/src/backend/distributed/master/master_repair_shards.c +++ b/src/backend/distributed/master/master_repair_shards.c @@ -83,7 +83,7 @@ master_copy_shard_placement(PG_FUNCTION_ARGS) "is only supported on Citus Enterprise"))); } - EnsureSchemaNode(); + EnsureCoordinator(); /* RepairShardPlacement function repairs only given shard */ RepairShardPlacement(shardId, sourceNodeName, sourceNodePort, targetNodeName, diff --git a/src/backend/distributed/metadata/metadata_sync.c b/src/backend/distributed/metadata/metadata_sync.c index 7068f231c..c239bd3ab 100644 --- a/src/backend/distributed/metadata/metadata_sync.c +++ b/src/backend/distributed/metadata/metadata_sync.c @@ -83,7 +83,7 @@ start_metadata_sync_to_node(PG_FUNCTION_ARGS) List *dropMetadataCommandList = NIL; List *createMetadataCommandList = NIL; - EnsureSchemaNode(); + EnsureCoordinator(); EnsureSuperUser(); PreventTransactionChain(true, "start_metadata_sync_to_node"); @@ -142,7 +142,7 @@ stop_metadata_sync_to_node(PG_FUNCTION_ARGS) char *nodeNameString = text_to_cstring(nodeName); WorkerNode *workerNode = NULL; - EnsureSchemaNode(); + EnsureCoordinator(); EnsureSuperUser(); workerNode = FindWorkerNode(nodeNameString, nodePort); diff --git a/src/backend/distributed/planner/multi_router_planner.c b/src/backend/distributed/planner/multi_router_planner.c index 68254c739..69b057b93 100644 --- a/src/backend/distributed/planner/multi_router_planner.c +++ b/src/backend/distributed/planner/multi_router_planner.c @@ -669,7 +669,7 @@ InsertSelectQuerySupported(Query *queryTree, RangeTblEntry *insertRte, /* we only do this check for INSERT ... SELECT queries */ AssertArg(InsertSelectQuery(queryTree)); - EnsureSchemaNode(); + EnsureCoordinator(); /* we do not expect to see a view in modify target */ foreach(rangeTableCell, queryTree->rtable) @@ -1196,7 +1196,7 @@ ModifyQuerySupported(Query *queryTree) Oid distributedTableId = ExtractFirstDistributedTableId(queryTree); uint32 rangeTableId = 1; Var *partitionColumn = PartitionColumn(distributedTableId, rangeTableId); - bool schemaNode = SchemaNode(); + bool isCoordinator = IsCoordinator(); List *rangeTableList = NIL; ListCell *rangeTableCell = NULL; bool hasValuesScan = false; @@ -1254,13 +1254,13 @@ ModifyQuerySupported(Query *queryTree) referenceTable = true; } - if (referenceTable && !schemaNode) + if (referenceTable && !isCoordinator) { return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED, "cannot perform distributed planning for the given" " modification", "Modifications to reference tables are " - "supported only from the schema node.", + "supported only from the coordinator.", NULL); } diff --git a/src/backend/distributed/utils/colocation_utils.c b/src/backend/distributed/utils/colocation_utils.c index 07b21922e..58faaf081 100644 --- a/src/backend/distributed/utils/colocation_utils.c +++ b/src/backend/distributed/utils/colocation_utils.c @@ -74,7 +74,7 @@ mark_tables_colocated(PG_FUNCTION_ARGS) "operation"))); } - EnsureSchemaNode(); + EnsureCoordinator(); relationIdDatumArray = DeconstructArrayObject(relationIdArrayObject); diff --git a/src/backend/distributed/utils/metadata_cache.c b/src/backend/distributed/utils/metadata_cache.c index 9567ab560..2939ade41 100644 --- a/src/backend/distributed/utils/metadata_cache.c +++ b/src/backend/distributed/utils/metadata_cache.c @@ -110,7 +110,7 @@ static bool workerNodeHashValid = false; static bool invalidationRegistered = false; -/* default value is -1, for schema node it's 0 and for worker nodes > 0 */ +/* default value is -1, for coordinator it's 0 and for worker nodes > 0 */ static int LocalGroupId = -1; /* built first time through in InitializePartitionCache */ diff --git a/src/backend/distributed/utils/node_metadata.c b/src/backend/distributed/utils/node_metadata.c index 169510dc4..1b9ca87a5 100644 --- a/src/backend/distributed/utils/node_metadata.c +++ b/src/backend/distributed/utils/node_metadata.c @@ -345,7 +345,7 @@ RemoveNodeFromCluster(char *nodeName, int32 nodePort, bool forceRemove) List *referenceTableList = NIL; uint32 deletedNodeId = INVALID_PLACEMENT_ID; - EnsureSchemaNode(); + EnsureCoordinator(); EnsureSuperUser(); workerNode = FindWorkerNode(nodeName, nodePort); @@ -424,7 +424,7 @@ AddNodeMetadata(char *nodeName, int32 nodePort, int32 groupId, char *nodeRack, char *nodeInsertCommand = NULL; List *workerNodeList = NIL; - EnsureSchemaNode(); + EnsureCoordinator(); EnsureSuperUser(); *nodeAlreadyExists = false; @@ -628,18 +628,18 @@ GetNextNodeId() /* - * EnsureSchemaNode checks if the current node is the schema node. If it does not, + * EnsureCoordinator checks if the current node is the coordinator. If it does not, * the function errors out. */ void -EnsureSchemaNode(void) +EnsureCoordinator(void) { int localGroupId = GetLocalGroupId(); if (localGroupId != 0) { ereport(ERROR, (errmsg("operation is not allowed on this node"), - errhint("Connect to the schema node and run it again."))); + errhint("Connect to the coordinator and run it again."))); } } diff --git a/src/backend/distributed/utils/reference_table_utils.c b/src/backend/distributed/utils/reference_table_utils.c index 5b8eedfef..873d064c6 100644 --- a/src/backend/distributed/utils/reference_table_utils.c +++ b/src/backend/distributed/utils/reference_table_utils.c @@ -57,7 +57,7 @@ upgrade_to_reference_table(PG_FUNCTION_ARGS) uint64 shardId = INVALID_SHARD_ID; DistTableCacheEntry *tableEntry = NULL; - EnsureSchemaNode(); + EnsureCoordinator(); if (!IsDistributedTable(relationId)) { diff --git a/src/include/distributed/master_protocol.h b/src/include/distributed/master_protocol.h index edd0ea653..6eddde757 100644 --- a/src/include/distributed/master_protocol.h +++ b/src/include/distributed/master_protocol.h @@ -93,7 +93,7 @@ extern int ShardMaxSize; extern int ShardPlacementPolicy; -extern bool SchemaNode(void); +extern bool IsCoordinator(void); /* Function declarations local to the distributed module */ extern bool CStoreTable(Oid relationId); diff --git a/src/include/distributed/worker_manager.h b/src/include/distributed/worker_manager.h index 19b2ff229..01ff53c4f 100644 --- a/src/include/distributed/worker_manager.h +++ b/src/include/distributed/worker_manager.h @@ -62,7 +62,7 @@ extern uint32 WorkerGetLiveNodeCount(void); extern List * WorkerNodeList(void); extern WorkerNode * FindWorkerNode(char *nodeName, int32 nodePort); extern List * ReadWorkerNodes(void); -extern void EnsureSchemaNode(void); +extern void EnsureCoordinator(void); /* Function declarations for worker node utilities */ extern int CompareWorkerNodes(const void *leftElement, const void *rightElement); diff --git a/src/test/regress/expected/multi_mx_ddl.out b/src/test/regress/expected/multi_mx_ddl.out index b57ee4cdd..132ed3e72 100644 --- a/src/test/regress/expected/multi_mx_ddl.out +++ b/src/test/regress/expected/multi_mx_ddl.out @@ -30,7 +30,7 @@ SELECT master_modify_multiple_shards('UPDATE mx_ddl_table SET version=0.1 WHERE -- SET NOT NULL ALTER TABLE mx_ddl_table ALTER COLUMN version SET NOT NULL; --- See that the changes are applied on schema node, worker tables and shards +-- See that the changes are applied on coordinator, worker tables and shards \d mx_ddl_table Table "public.mx_ddl_table" Column | Type | Modifiers @@ -70,7 +70,7 @@ Indexes: \d mx_ddl_table_1600001 INSERT INTO mx_ddl_table VALUES (37, 78, 2); INSERT INTO mx_ddl_table VALUES (38, 78); --- Switch to the schema node +-- Switch to the coordinator \c - - - :master_port -- SET DATA TYPE ALTER TABLE mx_ddl_table ALTER COLUMN version SET DATA TYPE double precision; @@ -94,7 +94,7 @@ SELECT * FROM mx_ddl_table ORDER BY key; 78 | 83 | 2.1 (11 rows) --- Switch to the schema node +-- Switch to the coordinator \c - - - :master_port -- DROP INDEX DROP INDEX ddl_test_index; @@ -106,7 +106,7 @@ ALTER TABLE mx_ddl_table ALTER COLUMN version DROP DEFAULT; ALTER TABLE mx_ddl_table ALTER COLUMN version DROP NOT NULL; -- DROP COLUMN ALTER TABLE mx_ddl_table DROP COLUMN version; --- See that the changes are applied on schema node, worker tables and shards +-- See that the changes are applied on coordinator, worker tables and shards \d mx_ddl_table Table "public.mx_ddl_table" Column | Type | Modifiers diff --git a/src/test/regress/expected/multi_mx_metadata.out b/src/test/regress/expected/multi_mx_metadata.out index 9386a9642..310cbb703 100644 --- a/src/test/regress/expected/multi_mx_metadata.out +++ b/src/test/regress/expected/multi_mx_metadata.out @@ -187,7 +187,7 @@ SELECT create_distributed_table('objects_for_xacts2', 'id'); (1 row) ROLLBACK; --- show that the table not exists on the schema node +-- show that the table not exists on the coordinator SELECT count(*) FROM pg_tables WHERE tablename = 'objects_for_xacts2' and schemaname = 'citus_mx_schema_for_xacts'; count ------- @@ -212,7 +212,7 @@ SELECT count(*) FROM pg_tables WHERE tablename LIKE 'objects_for_xacts2_%' and s -- make sure that master_drop_all_shards does not work from the worker nodes SELECT master_drop_all_shards('citus_mx_schema_for_xacts.objects_for_xacts'::regclass, 'citus_mx_schema_for_xacts', 'objects_for_xacts'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. -- Ensure pg_dist_transaction is empty for test SELECT recover_prepared_transactions(); recover_prepared_transactions diff --git a/src/test/regress/expected/multi_mx_modifications.out b/src/test/regress/expected/multi_mx_modifications.out index 12360d823..f72f222f0 100644 --- a/src/test/regress/expected/multi_mx_modifications.out +++ b/src/test/regress/expected/multi_mx_modifications.out @@ -113,7 +113,7 @@ DETAIL: Multi-row INSERTs to distributed tables are not supported. -- INSERT ... SELECT ... FROM commands are unsupported from workers INSERT INTO limit_orders_mx SELECT * FROM limit_orders_mx; ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. -- connect back to the other node \c - - - :worker_1_port -- commands containing a CTE are unsupported @@ -278,7 +278,7 @@ UPDATE limit_orders_mx SET symbol = UPPER(symbol) WHERE id = 246 RETURNING id, L 246 | gm | GM (1 row) --- connect schema node to run the DDL +-- connect coordinator to run the DDL \c - - - :master_port ALTER TABLE limit_orders_mx ADD COLUMN array_of_values integer[]; NOTICE: using one-phase commit for distributed DDL commands @@ -320,7 +320,7 @@ SELECT array_of_values FROM limit_orders_mx WHERE id = 246; {1,2} (1 row) --- connect schema node to run the DDL +-- connect coordinator to run the DDL \c - - - :master_port ALTER TABLE limit_orders_mx DROP array_of_values; NOTICE: using one-phase commit for distributed DDL commands diff --git a/src/test/regress/expected/multi_mx_modifying_xacts.out b/src/test/regress/expected/multi_mx_modifying_xacts.out index f702f2c53..62b5673ad 100644 --- a/src/test/regress/expected/multi_mx_modifying_xacts.out +++ b/src/test/regress/expected/multi_mx_modifying_xacts.out @@ -8,7 +8,7 @@ INSERT INTO researchers_mx VALUES (1, 1, 'Donald Knuth'); INSERT INTO researchers_mx VALUES (2, 1, 'Niklaus Wirth'); INSERT INTO researchers_mx VALUES (3, 2, 'Tony Hoare'); INSERT INTO researchers_mx VALUES (4, 2, 'Kenneth Iverson'); --- replace a researcher, reusing their id on the schema node +-- replace a researcher, reusing their id on the coordinator BEGIN; DELETE FROM researchers_mx WHERE lab_id = 1 AND id = 2; INSERT INTO researchers_mx VALUES (2, 1, 'John Backus'); diff --git a/src/test/regress/expected/multi_mx_tpch_query1.out b/src/test/regress/expected/multi_mx_tpch_query1.out index 2c361750a..a0b0ac086 100644 --- a/src/test/regress/expected/multi_mx_tpch_query1.out +++ b/src/test/regress/expected/multi_mx_tpch_query1.out @@ -3,7 +3,7 @@ -- ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1310000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large SET citus.large_table_shard_count TO 2; diff --git a/src/test/regress/expected/multi_mx_tpch_query12.out b/src/test/regress/expected/multi_mx_tpch_query12.out index f9f91e370..959b03fe6 100644 --- a/src/test/regress/expected/multi_mx_tpch_query12.out +++ b/src/test/regress/expected/multi_mx_tpch_query12.out @@ -3,7 +3,7 @@ -- ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1290000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large SET citus.large_table_shard_count TO 2; diff --git a/src/test/regress/expected/multi_mx_tpch_query14.out b/src/test/regress/expected/multi_mx_tpch_query14.out index dc31b46f9..68b6b381c 100644 --- a/src/test/regress/expected/multi_mx_tpch_query14.out +++ b/src/test/regress/expected/multi_mx_tpch_query14.out @@ -3,7 +3,7 @@ -- ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1280000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large SET citus.large_table_shard_count TO 2; diff --git a/src/test/regress/expected/multi_mx_tpch_query19.out b/src/test/regress/expected/multi_mx_tpch_query19.out index aca98444c..ae0b61d81 100644 --- a/src/test/regress/expected/multi_mx_tpch_query19.out +++ b/src/test/regress/expected/multi_mx_tpch_query19.out @@ -3,7 +3,7 @@ -- ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1270000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large SET citus.large_table_shard_count TO 2; diff --git a/src/test/regress/expected/multi_mx_tpch_query3.out b/src/test/regress/expected/multi_mx_tpch_query3.out index 74da826ec..3e7c99bc2 100644 --- a/src/test/regress/expected/multi_mx_tpch_query3.out +++ b/src/test/regress/expected/multi_mx_tpch_query3.out @@ -6,7 +6,7 @@ -- coming from postgresql.conf or multi_task_tracker_executor.conf. ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1260000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port SELECT l_orderkey, diff --git a/src/test/regress/expected/multi_mx_tpch_query6.out b/src/test/regress/expected/multi_mx_tpch_query6.out index 7c8aa8333..7a1949d21 100644 --- a/src/test/regress/expected/multi_mx_tpch_query6.out +++ b/src/test/regress/expected/multi_mx_tpch_query6.out @@ -3,7 +3,7 @@ -- ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1250000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large SET citus.large_table_shard_count TO 2; diff --git a/src/test/regress/expected/multi_mx_tpch_query7.out b/src/test/regress/expected/multi_mx_tpch_query7.out index fb6984c60..5b931980e 100644 --- a/src/test/regress/expected/multi_mx_tpch_query7.out +++ b/src/test/regress/expected/multi_mx_tpch_query7.out @@ -3,7 +3,7 @@ -- ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1230000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem AND orders tables as large SET citus.large_table_shard_count TO 2; diff --git a/src/test/regress/expected/multi_mx_tpch_query7_nested.out b/src/test/regress/expected/multi_mx_tpch_query7_nested.out index b5414f11d..16a9a1c6e 100644 --- a/src/test/regress/expected/multi_mx_tpch_query7_nested.out +++ b/src/test/regress/expected/multi_mx_tpch_query7_nested.out @@ -3,7 +3,7 @@ -- ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1240000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem AND orders tables AS large SET citus.large_table_shard_count TO 2; @@ -121,7 +121,7 @@ ORDER BY GERMANY | FRANCE | 1995 | 2399.2948 (1 row) --- connect to the schema node +-- connect to the coordinator \c - - - :worker_2_port ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1240000; diff --git a/src/test/regress/expected/multi_unsupported_worker_operations.out b/src/test/regress/expected/multi_unsupported_worker_operations.out index 0d9bfbf03..f94bfdc0a 100644 --- a/src/test/regress/expected/multi_unsupported_worker_operations.out +++ b/src/test/regress/expected/multi_unsupported_worker_operations.out @@ -73,15 +73,15 @@ CREATE TABLE mx_table_worker(col_1 text); -- master_create_distributed_table SELECT master_create_distributed_table('mx_table_worker', 'col_1', 'hash'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. -- create_distributed_table SELECT create_distributed_table('mx_table_worker', 'col_1'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. -- create_reference_table SELECT create_reference_table('mx_table_worker'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT count(*) FROM pg_dist_partition WHERE logicalrelid='mx_table_worker'::regclass; count ------- @@ -95,7 +95,7 @@ SELECT * FROM pg_dist_shard WHERE logicalrelid = 'mx_table'::regclass; DELETE FROM pg_dist_shard WHERE logicalrelid = 'mx_table'::regclass; SELECT master_create_worker_shards('mx_table', 5, 1); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT count(*) FROM pg_dist_shard WHERE logicalrelid='mx_table'::regclass; count ------- @@ -120,16 +120,16 @@ SELECT * FROM mx_ref_table ORDER BY col_1; INSERT INTO mx_ref_table (col_1, col_2) VALUES (-6, 'vestibulum'); ERROR: cannot perform distributed planning for the given modification -DETAIL: Modifications to reference tables are supported only from the schema node. +DETAIL: Modifications to reference tables are supported only from the coordinator. UPDATE mx_ref_table SET col_2 = 'habitant' WHERE col_1 = -37; ERROR: cannot perform distributed planning for the given modification -DETAIL: Modifications to reference tables are supported only from the schema node. +DETAIL: Modifications to reference tables are supported only from the coordinator. DELETE FROM mx_ref_table WHERE col_1 = -78; ERROR: cannot perform distributed planning for the given modification -DETAIL: Modifications to reference tables are supported only from the schema node. +DETAIL: Modifications to reference tables are supported only from the coordinator. COPY mx_ref_table (col_1, col_2) FROM STDIN WITH (FORMAT 'csv'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT * FROM mx_ref_table ORDER BY col_1; col_1 | col_2 -------+-------- @@ -152,13 +152,13 @@ DROP TABLE mx_ref_table; CREATE INDEX mx_test_index ON mx_table(col_1); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. ALTER TABLE mx_table ADD COLUMN col_4 int; ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. ALTER TABLE mx_table_2 ADD CONSTRAINT mx_fk_constraint FOREIGN KEY(col_1) REFERENCES mx_table(col_1); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. \d mx_table Table "public.mx_table" Column | Type | Modifiers @@ -170,7 +170,7 @@ HINT: Connect to the schema node and run it again. -- master_modify_multiple_shards SELECT master_modify_multiple_shards('UPDATE mx_table SET col_2=''none'''); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT count(*) FROM mx_table WHERE col_2='none'; count ------- @@ -185,7 +185,7 @@ SELECT count(*) FROM mx_table WHERE col_2!='none'; SELECT master_modify_multiple_shards('DELETE FROM mx_table'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT count(*) FROM mx_table; count ------- @@ -195,7 +195,7 @@ SELECT count(*) FROM mx_table; -- master_drop_all_shards SELECT master_drop_all_shards('mx_table'::regclass, 'public', 'mx_table'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT count(*) FROM pg_dist_shard NATURAL JOIN pg_dist_shard_placement WHERE logicalrelid='mx_table'::regclass; count ------- @@ -205,7 +205,7 @@ SELECT count(*) FROM pg_dist_shard NATURAL JOIN pg_dist_shard_placement WHERE lo -- master_apply_delete_command SELECT master_apply_delete_command('DELETE FROM mx_table'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT count(*) FROM mx_table; count ------- @@ -215,7 +215,7 @@ SELECT count(*) FROM mx_table; -- master_add_node SELECT master_add_node('localhost', 5432); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT * FROM pg_dist_node WHERE nodename='localhost' AND nodeport=5432; nodeid | groupid | nodename | nodeport | noderack | hasmetadata --------+---------+----------+----------+----------+------------- @@ -232,7 +232,7 @@ SELECT master_add_node('localhost', 5432); \c - - - :worker_1_port SELECT master_remove_node('localhost', 5432); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT * FROM pg_dist_node WHERE nodename='localhost' AND nodeport=5432; nodeid | groupid | nodename | nodeport | noderack | hasmetadata ---------+---------+-----------+----------+----------+------------- @@ -250,7 +250,7 @@ SELECT master_remove_node('localhost', 5432); \c - - - :worker_1_port TRUNCATE mx_table; ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. CONTEXT: SQL statement "SELECT master_modify_multiple_shards(commandText)" PL/pgSQL function citus_truncate_trigger() line 17 at PERFORM SELECT count(*) FROM mx_table; @@ -262,7 +262,7 @@ SELECT count(*) FROM mx_table; -- INSERT / SELECT INSERT INTO mx_table_2 SELECT * FROM mx_table; ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT count(*) FROM mx_table_2; count ------- @@ -273,7 +273,7 @@ SELECT count(*) FROM mx_table_2; UPDATE pg_dist_partition SET colocationid = 0 WHERE logicalrelid='mx_table_2'::regclass; SELECT mark_tables_colocated('mx_table', ARRAY['mx_table_2']); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT colocationid FROM pg_dist_partition WHERE logicalrelid='mx_table_2'::regclass; colocationid -------------- @@ -289,7 +289,7 @@ WHERE logicalrelid='mx_table_2'::regclass; -- start_metadata_sync_to_node SELECT start_metadata_sync_to_node('localhost', :worker_2_port); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_port; hasmetadata ------------- @@ -307,7 +307,7 @@ SELECT start_metadata_sync_to_node('localhost', :worker_2_port); \c - - - :worker_1_port SELECT stop_metadata_sync_to_node('localhost', :worker_2_port); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. \c - - - :master_port SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_port; hasmetadata @@ -340,7 +340,7 @@ SELECT worker_drop_distributed_table(logicalrelid) FROM pg_dist_partition; -- DROP TABLE DROP TABLE mx_table; ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. CONTEXT: SQL statement "SELECT master_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name)" PL/pgSQL function citus_drop_trigger() line 21 at PERFORM SELECT count(*) FROM mx_table; @@ -352,7 +352,7 @@ SELECT count(*) FROM mx_table; -- master_drop_distributed_table_metadata SELECT master_drop_distributed_table_metadata('mx_table'::regclass, 'public', 'mx_table'); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT count(*) FROM mx_table; count ------- @@ -369,7 +369,7 @@ INSERT INTO pg_dist_shard_placement (nodename, nodeport, shardid, shardstate, sh VALUES ('localhost', :worker_2_port, :testshardid, 3, 0); SELECT master_copy_shard_placement(:testshardid, 'localhost', :worker_1_port, 'localhost', :worker_2_port); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. SELECT shardid, nodename, nodeport, shardstate FROM pg_dist_shard_placement WHERE shardid = :testshardid @@ -384,7 +384,7 @@ DELETE FROM pg_dist_shard_placement WHERE nodeport = :worker_2_port AND shardid -- master_get_new_placementid SELECT master_get_new_placementid(); ERROR: operation is not allowed on this node -HINT: Connect to the schema node and run it again. +HINT: Connect to the coordinator and run it again. -- Cleanup \c - - - :master_port DROP TABLE mx_table; diff --git a/src/test/regress/sql/multi_mx_ddl.sql b/src/test/regress/sql/multi_mx_ddl.sql index d9778a365..0afa624fd 100644 --- a/src/test/regress/sql/multi_mx_ddl.sql +++ b/src/test/regress/sql/multi_mx_ddl.sql @@ -20,7 +20,7 @@ SELECT master_modify_multiple_shards('UPDATE mx_ddl_table SET version=0.1 WHERE ALTER TABLE mx_ddl_table ALTER COLUMN version SET NOT NULL; --- See that the changes are applied on schema node, worker tables and shards +-- See that the changes are applied on coordinator, worker tables and shards \d mx_ddl_table \c - - - :worker_1_port @@ -38,7 +38,7 @@ ALTER TABLE mx_ddl_table ALTER COLUMN version SET NOT NULL; INSERT INTO mx_ddl_table VALUES (37, 78, 2); INSERT INTO mx_ddl_table VALUES (38, 78); --- Switch to the schema node +-- Switch to the coordinator \c - - - :master_port @@ -50,7 +50,7 @@ INSERT INTO mx_ddl_table VALUES (78, 83, 2.1); \c - - - :worker_1_port SELECT * FROM mx_ddl_table ORDER BY key; --- Switch to the schema node +-- Switch to the coordinator \c - - - :master_port -- DROP INDEX @@ -66,7 +66,7 @@ ALTER TABLE mx_ddl_table ALTER COLUMN version DROP NOT NULL; ALTER TABLE mx_ddl_table DROP COLUMN version; --- See that the changes are applied on schema node, worker tables and shards +-- See that the changes are applied on coordinator, worker tables and shards \d mx_ddl_table \c - - - :worker_1_port diff --git a/src/test/regress/sql/multi_mx_metadata.sql b/src/test/regress/sql/multi_mx_metadata.sql index c51260fbf..9a63bad5b 100644 --- a/src/test/regress/sql/multi_mx_metadata.sql +++ b/src/test/regress/sql/multi_mx_metadata.sql @@ -117,7 +117,7 @@ SELECT create_distributed_table('objects_for_xacts2', 'id'); ROLLBACK; --- show that the table not exists on the schema node +-- show that the table not exists on the coordinator SELECT count(*) FROM pg_tables WHERE tablename = 'objects_for_xacts2' and schemaname = 'citus_mx_schema_for_xacts'; \c - - - :worker_1_port diff --git a/src/test/regress/sql/multi_mx_modifications.sql b/src/test/regress/sql/multi_mx_modifications.sql index 89805f23d..373e7ce05 100644 --- a/src/test/regress/sql/multi_mx_modifications.sql +++ b/src/test/regress/sql/multi_mx_modifications.sql @@ -183,7 +183,7 @@ SELECT symbol, bidder_id FROM limit_orders_mx WHERE id = 246; -- IMMUTABLE functions are allowed -- even in returning UPDATE limit_orders_mx SET symbol = UPPER(symbol) WHERE id = 246 RETURNING id, LOWER(symbol), symbol; --- connect schema node to run the DDL +-- connect coordinator to run the DDL \c - - - :master_port ALTER TABLE limit_orders_mx ADD COLUMN array_of_values integer[]; @@ -219,7 +219,7 @@ UPDATE limit_orders_mx SET bidder_id = temp_strict_func(1, null) WHERE id = 246; SELECT array_of_values FROM limit_orders_mx WHERE id = 246; --- connect schema node to run the DDL +-- connect coordinator to run the DDL \c - - - :master_port ALTER TABLE limit_orders_mx DROP array_of_values; diff --git a/src/test/regress/sql/multi_mx_modifying_xacts.sql b/src/test/regress/sql/multi_mx_modifying_xacts.sql index f04cab33b..aaf25c722 100644 --- a/src/test/regress/sql/multi_mx_modifying_xacts.sql +++ b/src/test/regress/sql/multi_mx_modifying_xacts.sql @@ -13,7 +13,7 @@ INSERT INTO researchers_mx VALUES (2, 1, 'Niklaus Wirth'); INSERT INTO researchers_mx VALUES (3, 2, 'Tony Hoare'); INSERT INTO researchers_mx VALUES (4, 2, 'Kenneth Iverson'); --- replace a researcher, reusing their id on the schema node +-- replace a researcher, reusing their id on the coordinator BEGIN; DELETE FROM researchers_mx WHERE lab_id = 1 AND id = 2; INSERT INTO researchers_mx VALUES (2, 1, 'John Backus'); diff --git a/src/test/regress/sql/multi_mx_tpch_query1.sql b/src/test/regress/sql/multi_mx_tpch_query1.sql index ef80029c6..2b81d17fa 100644 --- a/src/test/regress/sql/multi_mx_tpch_query1.sql +++ b/src/test/regress/sql/multi_mx_tpch_query1.sql @@ -6,7 +6,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1310000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large diff --git a/src/test/regress/sql/multi_mx_tpch_query12.sql b/src/test/regress/sql/multi_mx_tpch_query12.sql index a15d90d57..340c37530 100644 --- a/src/test/regress/sql/multi_mx_tpch_query12.sql +++ b/src/test/regress/sql/multi_mx_tpch_query12.sql @@ -6,7 +6,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1290000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large diff --git a/src/test/regress/sql/multi_mx_tpch_query14.sql b/src/test/regress/sql/multi_mx_tpch_query14.sql index 8cc4ad083..b4b6e5561 100644 --- a/src/test/regress/sql/multi_mx_tpch_query14.sql +++ b/src/test/regress/sql/multi_mx_tpch_query14.sql @@ -6,7 +6,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1280000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large diff --git a/src/test/regress/sql/multi_mx_tpch_query19.sql b/src/test/regress/sql/multi_mx_tpch_query19.sql index ec2c0d6de..7f2248406 100644 --- a/src/test/regress/sql/multi_mx_tpch_query19.sql +++ b/src/test/regress/sql/multi_mx_tpch_query19.sql @@ -6,7 +6,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1270000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large diff --git a/src/test/regress/sql/multi_mx_tpch_query3.sql b/src/test/regress/sql/multi_mx_tpch_query3.sql index 26560575f..403631c61 100644 --- a/src/test/regress/sql/multi_mx_tpch_query3.sql +++ b/src/test/regress/sql/multi_mx_tpch_query3.sql @@ -10,7 +10,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1260000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port SELECT diff --git a/src/test/regress/sql/multi_mx_tpch_query6.sql b/src/test/regress/sql/multi_mx_tpch_query6.sql index 2e52ab5a9..d6f8654b2 100644 --- a/src/test/regress/sql/multi_mx_tpch_query6.sql +++ b/src/test/regress/sql/multi_mx_tpch_query6.sql @@ -6,7 +6,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1250000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem and orders tables as large diff --git a/src/test/regress/sql/multi_mx_tpch_query7.sql b/src/test/regress/sql/multi_mx_tpch_query7.sql index 2e1739d87..b23dec210 100644 --- a/src/test/regress/sql/multi_mx_tpch_query7.sql +++ b/src/test/regress/sql/multi_mx_tpch_query7.sql @@ -6,7 +6,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1230000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem AND orders tables as large diff --git a/src/test/regress/sql/multi_mx_tpch_query7_nested.sql b/src/test/regress/sql/multi_mx_tpch_query7_nested.sql index 702d8c91d..889dfaacb 100644 --- a/src/test/regress/sql/multi_mx_tpch_query7_nested.sql +++ b/src/test/regress/sql/multi_mx_tpch_query7_nested.sql @@ -6,7 +6,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000; ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 1240000; --- connect to the schema node +-- connect to the coordinator \c - - - :master_port -- Change configuration to treat lineitem AND orders tables AS large @@ -125,7 +125,7 @@ ORDER BY cust_nation, l_year; --- connect to the schema node +-- connect to the coordinator \c - - - :worker_2_port ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;