diff --git a/src/test/regress/expected/multi_cluster_management.out b/src/test/regress/expected/multi_cluster_management.out index e6634d5c6..3e829ee5a 100644 --- a/src/test/regress/expected/multi_cluster_management.out +++ b/src/test/regress/expected/multi_cluster_management.out @@ -72,6 +72,45 @@ SELECT master_get_active_worker_nodes(); (localhost,57637) (2 rows) +-- get all nodes +SELECT * from citus_nodes; + nodename | nodeport | role | active +--------------------------------------------------------------------- + localhost | 57637 | worker | t + localhost | 57638 | worker | t + localhost | 57636 | coordinator | t +(3 rows) + +-- get get active nodes +SELECT * from citus_nodes where active = 't'; + nodename | nodeport | role | active +--------------------------------------------------------------------- + localhost | 57637 | worker | t + localhost | 57638 | worker | t + localhost | 57636 | coordinator | t +(3 rows) + +-- get coordinator nodes +SELECT * from citus_nodes where role = 'coordinator'; + nodename | nodeport | role | active +--------------------------------------------------------------------- + localhost | 57636 | coordinator | t +(1 row) + +-- get worker nodes +SELECT * from citus_nodes where role = 'worker'; + nodename | nodeport | role | active +--------------------------------------------------------------------- + localhost | 57637 | worker | t + localhost | 57638 | worker | t +(2 rows) + +-- get nodes with unknown role +SELECT * from citus_nodes where role = 'foo'; + nodename | nodeport | role | active +--------------------------------------------------------------------- +(0 rows) + -- try to add a node that is already in the cluster SELECT * FROM master_add_node('localhost', :worker_1_port); master_add_node @@ -126,6 +165,21 @@ SELECT master_get_active_worker_nodes(); (localhost,57637) (1 row) +-- get get active nodes +SELECT * from citus_nodes where active = 't'; + nodename | nodeport | role | active +--------------------------------------------------------------------- + localhost | 57636 | coordinator | t + localhost | 57637 | worker | t +(2 rows) + +-- get get inactive nodes +SELECT * from citus_nodes where active = 'f'; + nodename | nodeport | role | active +--------------------------------------------------------------------- + localhost | 57638 | worker | f +(1 row) + -- add some shard placements to the cluster SET citus.shard_count TO 16; SET citus.shard_replication_factor TO 1; diff --git a/src/test/regress/sql/multi_cluster_management.sql b/src/test/regress/sql/multi_cluster_management.sql index a1e0e9b09..05273be16 100644 --- a/src/test/regress/sql/multi_cluster_management.sql +++ b/src/test/regress/sql/multi_cluster_management.sql @@ -32,6 +32,21 @@ SELECT result FROM run_command_on_workers('SELECT citus_is_primary_node()'); -- get the active nodes SELECT master_get_active_worker_nodes(); +-- get all nodes +SELECT * from citus_nodes; + +-- get get active nodes +SELECT * from citus_nodes where active = 't'; + +-- get coordinator nodes +SELECT * from citus_nodes where role = 'coordinator'; + +-- get worker nodes +SELECT * from citus_nodes where role = 'worker'; + +-- get nodes with unknown role +SELECT * from citus_nodes where role = 'foo'; + -- try to add a node that is already in the cluster SELECT * FROM master_add_node('localhost', :worker_1_port); @@ -51,6 +66,12 @@ SELECT citus_disable_node('localhost', :worker_2_port); SELECT public.wait_until_metadata_sync(20000); SELECT master_get_active_worker_nodes(); +-- get get active nodes +SELECT * from citus_nodes where active = 't'; + +-- get get inactive nodes +SELECT * from citus_nodes where active = 'f'; + -- add some shard placements to the cluster SET citus.shard_count TO 16; SET citus.shard_replication_factor TO 1;