mirror of https://github.com/citusdata/citus.git
Merge pull request #3786 from citusdata/coord-skip-dep-setup
Skip dependency setup on coordinator nodepull/3790/head
commit
2e0cb6160c
|
@ -380,6 +380,9 @@ master_set_node_property(PG_FUNCTION_ARGS)
|
||||||
* - All dependencies (e.g., types, schemas)
|
* - All dependencies (e.g., types, schemas)
|
||||||
* - Reference tables, because they are needed to handle queries efficiently.
|
* - Reference tables, because they are needed to handle queries efficiently.
|
||||||
* - Distributed functions
|
* - Distributed functions
|
||||||
|
*
|
||||||
|
* Note that we do not create the distributed dependencies on the coordinator
|
||||||
|
* since all the dependencies should be present in the coordinator already.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
SetUpDistributedTableDependencies(WorkerNode *newWorkerNode)
|
SetUpDistributedTableDependencies(WorkerNode *newWorkerNode)
|
||||||
|
@ -388,13 +391,13 @@ SetUpDistributedTableDependencies(WorkerNode *newWorkerNode)
|
||||||
{
|
{
|
||||||
EnsureNoModificationsHaveBeenDone();
|
EnsureNoModificationsHaveBeenDone();
|
||||||
|
|
||||||
if (ShouldPropagate())
|
if (ShouldPropagate() && !NodeIsCoordinator(newWorkerNode))
|
||||||
{
|
{
|
||||||
PropagateNodeWideObjects(newWorkerNode);
|
PropagateNodeWideObjects(newWorkerNode);
|
||||||
ReplicateAllDependenciesToNode(newWorkerNode->workerName,
|
ReplicateAllDependenciesToNode(newWorkerNode->workerName,
|
||||||
newWorkerNode->workerPort);
|
newWorkerNode->workerPort);
|
||||||
}
|
}
|
||||||
else
|
else if (!NodeIsCoordinator(newWorkerNode))
|
||||||
{
|
{
|
||||||
ereport(WARNING, (errmsg("citus.enable_object_propagation is off, not "
|
ereport(WARNING, (errmsg("citus.enable_object_propagation is off, not "
|
||||||
"creating distributed objects on worker"),
|
"creating distributed objects on worker"),
|
||||||
|
|
|
@ -4,18 +4,6 @@ SET client_min_messages TO DEBUG;
|
||||||
SET citus.next_shard_id TO 1570000;
|
SET citus.next_shard_id TO 1570000;
|
||||||
SET citus.replicate_reference_tables_on_activate TO off;
|
SET citus.replicate_reference_tables_on_activate TO off;
|
||||||
SELECT * FROM master_add_node('localhost', :master_port, groupid := 0);
|
SELECT * FROM master_add_node('localhost', :master_port, groupid := 0);
|
||||||
DEBUG: schema "public" already exists, skipping
|
|
||||||
DETAIL: from localhost:xxxxx
|
|
||||||
DEBUG: extension "plpgsql" already exists, skipping
|
|
||||||
DETAIL: from localhost:xxxxx
|
|
||||||
DEBUG: schema "citus_mx_test_schema" already exists, skipping
|
|
||||||
DETAIL: from localhost:xxxxx
|
|
||||||
DEBUG: schema "citus_mx_test_schema_join_1" already exists, skipping
|
|
||||||
DETAIL: from localhost:xxxxx
|
|
||||||
DEBUG: schema "citus_mx_test_schema_join_2" already exists, skipping
|
|
||||||
DETAIL: from localhost:xxxxx
|
|
||||||
DEBUG: schema "citus_mx_schema_for_xacts" already exists, skipping
|
|
||||||
DETAIL: from localhost:xxxxx
|
|
||||||
master_add_node
|
master_add_node
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
32
|
32
|
||||||
|
|
|
@ -427,6 +427,18 @@ ROLLBACK;
|
||||||
-- see https://github.com/citusdata/citus/issues/3279
|
-- see https://github.com/citusdata/citus/issues/3279
|
||||||
ALTER TABLE squares DROP COLUMN b;
|
ALTER TABLE squares DROP COLUMN b;
|
||||||
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (8000000, 'replicate_ref_to_coordinator', 'ALTER TABLE squares DROP COLUMN b;')
|
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (8000000, 'replicate_ref_to_coordinator', 'ALTER TABLE squares DROP COLUMN b;')
|
||||||
|
-- verify that we replicate the reference tables that are distributed before
|
||||||
|
-- adding the coordinator as a worker.
|
||||||
|
SELECT master_remove_node('localhost', :master_port);
|
||||||
|
master_remove_node
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
-- add the coordinator as a worker node and verify that the reference tables are replicated
|
||||||
|
SELECT master_add_node('localhost', :master_port, groupid => 0) AS master_nodeid \gset
|
||||||
|
NOTICE: Replicating reference table "squares" to the node localhost:xxxxx
|
||||||
|
NOTICE: Replicating reference table "numbers" to the node localhost:xxxxx
|
||||||
-- clean-up
|
-- clean-up
|
||||||
SET client_min_messages TO ERROR;
|
SET client_min_messages TO ERROR;
|
||||||
DROP SCHEMA replicate_ref_to_coordinator CASCADE;
|
DROP SCHEMA replicate_ref_to_coordinator CASCADE;
|
||||||
|
|
|
@ -250,6 +250,12 @@ ROLLBACK;
|
||||||
-- see https://github.com/citusdata/citus/issues/3279
|
-- see https://github.com/citusdata/citus/issues/3279
|
||||||
ALTER TABLE squares DROP COLUMN b;
|
ALTER TABLE squares DROP COLUMN b;
|
||||||
|
|
||||||
|
-- verify that we replicate the reference tables that are distributed before
|
||||||
|
-- adding the coordinator as a worker.
|
||||||
|
SELECT master_remove_node('localhost', :master_port);
|
||||||
|
|
||||||
|
-- add the coordinator as a worker node and verify that the reference tables are replicated
|
||||||
|
SELECT master_add_node('localhost', :master_port, groupid => 0) AS master_nodeid \gset
|
||||||
|
|
||||||
-- clean-up
|
-- clean-up
|
||||||
SET client_min_messages TO ERROR;
|
SET client_min_messages TO ERROR;
|
||||||
|
|
Loading…
Reference in New Issue