mirror of https://github.com/citusdata/citus.git
Adds the necessary regress tests
parent
b801d358b5
commit
e15a94ec3b
|
@ -25,6 +25,15 @@ SELECT citus_is_coordinator();
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
-- I am primary node (fails beacuse not set in pg_dist)
|
||||||
|
select citus_is_primary_node();
|
||||||
|
WARNING: could not find the current node in pg_dist_node
|
||||||
|
DETAIL: If this is the coordinator node, consider adding it into the metadata by using citus_set_coordinator_host() UDF. Otherwise, if you're going to use this node as a worker node for a new cluster, make sure to add this node into the metadata from the coordinator by using citus_add_node() UDF.
|
||||||
|
citus_is_primary_node
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- make sure coordinator is always in metadata.
|
-- make sure coordinator is always in metadata.
|
||||||
SELECT citus_set_coordinator_host('localhost');
|
SELECT citus_set_coordinator_host('localhost');
|
||||||
citus_set_coordinator_host
|
citus_set_coordinator_host
|
||||||
|
@ -32,6 +41,13 @@ SELECT citus_set_coordinator_host('localhost');
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
-- I am primary node
|
||||||
|
select citus_is_primary_node();
|
||||||
|
citus_is_primary_node
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- workers are not coordinator
|
-- workers are not coordinator
|
||||||
SELECT result FROM run_command_on_workers('SELECT citus_is_coordinator()');
|
SELECT result FROM run_command_on_workers('SELECT citus_is_coordinator()');
|
||||||
result
|
result
|
||||||
|
@ -40,6 +56,14 @@ SELECT result FROM run_command_on_workers('SELECT citus_is_coordinator()');
|
||||||
f
|
f
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
|
-- primary workers are primary node
|
||||||
|
SELECT result FROM run_command_on_workers('SELECT citus_is_primary_node()');
|
||||||
|
result
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
t
|
||||||
|
t
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
-- get the active nodes
|
-- get the active nodes
|
||||||
SELECT master_get_active_worker_nodes();
|
SELECT master_get_active_worker_nodes();
|
||||||
master_get_active_worker_nodes
|
master_get_active_worker_nodes
|
||||||
|
|
|
@ -14,12 +14,18 @@ RESET citus.metadata_sync_mode;
|
||||||
-- I am coordinator
|
-- I am coordinator
|
||||||
SELECT citus_is_coordinator();
|
SELECT citus_is_coordinator();
|
||||||
|
|
||||||
|
-- I am primary node
|
||||||
|
select citus.citus_is_primary_node();
|
||||||
|
|
||||||
-- make sure coordinator is always in metadata.
|
-- make sure coordinator is always in metadata.
|
||||||
SELECT citus_set_coordinator_host('localhost');
|
SELECT citus_set_coordinator_host('localhost');
|
||||||
|
|
||||||
-- workers are not coordinator
|
-- workers are not coordinator
|
||||||
SELECT result FROM run_command_on_workers('SELECT citus_is_coordinator()');
|
SELECT result FROM run_command_on_workers('SELECT citus_is_coordinator()');
|
||||||
|
|
||||||
|
-- primary workers are primary node
|
||||||
|
SELECT result FROM run_command_on_workers('SELECT citus_is_primary_node()');
|
||||||
|
|
||||||
-- get the active nodes
|
-- get the active nodes
|
||||||
SELECT master_get_active_worker_nodes();
|
SELECT master_get_active_worker_nodes();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue