mirror of https://github.com/citusdata/citus.git
Enable single node tests with Citus MX (#5595)
* Enable single node tests with Citus MX The test already has comment on the changespull/5596/head
parent
2e03efd91e
commit
6d9218540b
|
@ -136,13 +136,26 @@ SELECT groupid, nodename, nodeport, isactive, shouldhaveshards, hasmetadata, met
|
||||||
0 | localhost | 57636 | t | t | t | t
|
0 | localhost | 57636 | t | t | t | t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- cannot add workers with specific IP as long as I have a placeholder coordinator record
|
BEGIN;
|
||||||
SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port);
|
-- we should not enable MX for this temporary node just because
|
||||||
|
-- it'd spawn a bg worker targeting this node
|
||||||
|
-- and that changes the connection count specific tests
|
||||||
|
-- here
|
||||||
|
SET LOCAL citus.enable_metadata_sync_by_default TO OFF;
|
||||||
|
-- cannot add workers with specific IP as long as I have a placeholder coordinator record
|
||||||
|
SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port);
|
||||||
ERROR: cannot add a worker node when the coordinator hostname is set to localhost
|
ERROR: cannot add a worker node when the coordinator hostname is set to localhost
|
||||||
DETAIL: Worker nodes need to be able to connect to the coordinator to transfer data.
|
DETAIL: Worker nodes need to be able to connect to the coordinator to transfer data.
|
||||||
HINT: Use SELECT citus_set_coordinator_host('<hostname>') to configure the coordinator hostname
|
HINT: Use SELECT citus_set_coordinator_host('<hostname>') to configure the coordinator hostname
|
||||||
-- adding localhost workers is ok
|
COMMIT;
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_1_port);
|
BEGIN;
|
||||||
|
-- we should not enable MX for this temporary node just because
|
||||||
|
-- it'd spawn a bg worker targeting this node
|
||||||
|
-- and that changes the connection count specific tests
|
||||||
|
-- here
|
||||||
|
SET LOCAL citus.enable_metadata_sync_by_default TO OFF;
|
||||||
|
-- adding localhost workers is ok
|
||||||
|
SELECT 1 FROM master_add_node('localhost', :worker_1_port);
|
||||||
NOTICE: shards are still on the coordinator after adding the new node
|
NOTICE: shards are still on the coordinator after adding the new node
|
||||||
HINT: Use SELECT rebalance_table_shards(); to balance shards data between workers and coordinator or SELECT citus_drain_node('localhost',57636); to permanently move shards away from the coordinator.
|
HINT: Use SELECT rebalance_table_shards(); to balance shards data between workers and coordinator or SELECT citus_drain_node('localhost',57636); to permanently move shards away from the coordinator.
|
||||||
?column?
|
?column?
|
||||||
|
@ -150,6 +163,8 @@ HINT: Use SELECT rebalance_table_shards(); to balance shards data between worke
|
||||||
1
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
-- we don't need this node anymore
|
||||||
SELECT 1 FROM master_remove_node('localhost', :worker_1_port);
|
SELECT 1 FROM master_remove_node('localhost', :worker_1_port);
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
@ -163,8 +178,14 @@ SELECT 1 FROM citus_set_coordinator_host('127.0.0.1');
|
||||||
1
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- adding workers with specific IP is ok now
|
BEGIN;
|
||||||
SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port);
|
-- we should not enable MX for this temporary node just because
|
||||||
|
-- it'd spawn a bg worker targeting this node
|
||||||
|
-- and that changes the connection count specific tests
|
||||||
|
-- here
|
||||||
|
SET LOCAL citus.enable_metadata_sync_by_default TO OFF;
|
||||||
|
-- adding workers with specific IP is ok now
|
||||||
|
SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port);
|
||||||
NOTICE: shards are still on the coordinator after adding the new node
|
NOTICE: shards are still on the coordinator after adding the new node
|
||||||
HINT: Use SELECT rebalance_table_shards(); to balance shards data between workers and coordinator or SELECT citus_drain_node('127.0.0.1',57636); to permanently move shards away from the coordinator.
|
HINT: Use SELECT rebalance_table_shards(); to balance shards data between workers and coordinator or SELECT citus_drain_node('127.0.0.1',57636); to permanently move shards away from the coordinator.
|
||||||
?column?
|
?column?
|
||||||
|
@ -172,6 +193,8 @@ HINT: Use SELECT rebalance_table_shards(); to balance shards data between worke
|
||||||
1
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
-- we don't need this node anymore
|
||||||
SELECT 1 FROM master_remove_node('127.0.0.1', :worker_1_port);
|
SELECT 1 FROM master_remove_node('127.0.0.1', :worker_1_port);
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
|
@ -16,10 +16,8 @@
|
||||||
# Tests around schema changes, these are run first, so there's no preexisting objects.
|
# Tests around schema changes, these are run first, so there's no preexisting objects.
|
||||||
# ---
|
# ---
|
||||||
test: multi_extension
|
test: multi_extension
|
||||||
test: turn_mx_off
|
|
||||||
test: single_node
|
test: single_node
|
||||||
test: single_node_truncate
|
test: single_node_truncate
|
||||||
test: turn_mx_on
|
|
||||||
test: multi_test_helpers multi_test_helpers_superuser
|
test: multi_test_helpers multi_test_helpers_superuser
|
||||||
test: multi_cluster_management
|
test: multi_cluster_management
|
||||||
|
|
||||||
|
|
|
@ -67,18 +67,43 @@ SELECT create_distributed_table('test','x');
|
||||||
|
|
||||||
SELECT groupid, nodename, nodeport, isactive, shouldhaveshards, hasmetadata, metadatasynced FROM pg_dist_node;
|
SELECT groupid, nodename, nodeport, isactive, shouldhaveshards, hasmetadata, metadatasynced FROM pg_dist_node;
|
||||||
|
|
||||||
-- cannot add workers with specific IP as long as I have a placeholder coordinator record
|
BEGIN;
|
||||||
SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port);
|
-- we should not enable MX for this temporary node just because
|
||||||
|
-- it'd spawn a bg worker targeting this node
|
||||||
|
-- and that changes the connection count specific tests
|
||||||
|
-- here
|
||||||
|
SET LOCAL citus.enable_metadata_sync_by_default TO OFF;
|
||||||
|
-- cannot add workers with specific IP as long as I have a placeholder coordinator record
|
||||||
|
SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port);
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
-- adding localhost workers is ok
|
BEGIN;
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_1_port);
|
-- we should not enable MX for this temporary node just because
|
||||||
|
-- it'd spawn a bg worker targeting this node
|
||||||
|
-- and that changes the connection count specific tests
|
||||||
|
-- here
|
||||||
|
SET LOCAL citus.enable_metadata_sync_by_default TO OFF;
|
||||||
|
-- adding localhost workers is ok
|
||||||
|
SELECT 1 FROM master_add_node('localhost', :worker_1_port);
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
-- we don't need this node anymore
|
||||||
SELECT 1 FROM master_remove_node('localhost', :worker_1_port);
|
SELECT 1 FROM master_remove_node('localhost', :worker_1_port);
|
||||||
|
|
||||||
-- set the coordinator host to something different than localhost
|
-- set the coordinator host to something different than localhost
|
||||||
SELECT 1 FROM citus_set_coordinator_host('127.0.0.1');
|
SELECT 1 FROM citus_set_coordinator_host('127.0.0.1');
|
||||||
|
|
||||||
-- adding workers with specific IP is ok now
|
BEGIN;
|
||||||
SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port);
|
-- we should not enable MX for this temporary node just because
|
||||||
|
-- it'd spawn a bg worker targeting this node
|
||||||
|
-- and that changes the connection count specific tests
|
||||||
|
-- here
|
||||||
|
SET LOCAL citus.enable_metadata_sync_by_default TO OFF;
|
||||||
|
-- adding workers with specific IP is ok now
|
||||||
|
SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port);
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
-- we don't need this node anymore
|
||||||
SELECT 1 FROM master_remove_node('127.0.0.1', :worker_1_port);
|
SELECT 1 FROM master_remove_node('127.0.0.1', :worker_1_port);
|
||||||
|
|
||||||
-- set the coordinator host back to localhost for the remainder of tests
|
-- set the coordinator host back to localhost for the remainder of tests
|
||||||
|
|
Loading…
Reference in New Issue