mirror of https://github.com/citusdata/citus.git
Add tests for intermediate results
parent
bd12d90597
commit
1e22bcc8e7
|
@ -300,6 +300,34 @@ BEGIN;
|
|||
16
|
||||
(2 rows)
|
||||
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
-- now allow at most 1 connection, and ensure that intermediate
|
||||
-- results don't require any extra connections
|
||||
SET LOCAL citus.max_adaptive_executor_pool_size TO 1;
|
||||
SET LOCAL citus.task_assignment_policy TO "round-robin";
|
||||
SELECT cnt FROM (SELECT count(*) as cnt, random() FROM test LIMIT 1) as foo;
|
||||
cnt
|
||||
---------------------------------------------------------------------
|
||||
101
|
||||
(1 row)
|
||||
|
||||
-- queries with intermediate results don't use any extra connections
|
||||
SELECT
|
||||
connection_count_to_node
|
||||
FROM
|
||||
citus_remote_connection_stats()
|
||||
WHERE
|
||||
port IN (SELECT node_port FROM master_get_active_worker_nodes()) AND
|
||||
database_name = 'regression'
|
||||
ORDER BY
|
||||
hostname, port;
|
||||
connection_count_to_node
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(2 rows)
|
||||
|
||||
COMMIT;
|
||||
-- now show that when max_cached_conns_per_worker > 1
|
||||
-- Citus forces the first execution to open at least 2
|
||||
|
|
|
@ -172,6 +172,26 @@ BEGIN;
|
|||
hostname, port;
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
-- now allow at most 1 connection, and ensure that intermediate
|
||||
-- results don't require any extra connections
|
||||
SET LOCAL citus.max_adaptive_executor_pool_size TO 1;
|
||||
SET LOCAL citus.task_assignment_policy TO "round-robin";
|
||||
SELECT cnt FROM (SELECT count(*) as cnt, random() FROM test LIMIT 1) as foo;
|
||||
|
||||
-- queries with intermediate results don't use any extra connections
|
||||
SELECT
|
||||
connection_count_to_node
|
||||
FROM
|
||||
citus_remote_connection_stats()
|
||||
WHERE
|
||||
port IN (SELECT node_port FROM master_get_active_worker_nodes()) AND
|
||||
database_name = 'regression'
|
||||
ORDER BY
|
||||
hostname, port;
|
||||
COMMIT;
|
||||
|
||||
|
||||
-- now show that when max_cached_conns_per_worker > 1
|
||||
-- Citus forces the first execution to open at least 2
|
||||
-- connections that are cached. Later, that 2 cached
|
||||
|
@ -200,6 +220,9 @@ BEGIN;
|
|||
hostname, port;
|
||||
COMMIT;
|
||||
|
||||
|
||||
|
||||
|
||||
-- connection_retry_timeout cannot be smaller than node_connection_timeout
|
||||
SET citus.connection_retry_timeout TO 1000;
|
||||
|
||||
|
|
Loading…
Reference in New Issue