mirror of https://github.com/citusdata/citus.git
add invalidate_inactive_shared_connections test function
We introduce invalidate_inactive_shared_connections udf to be used in testing. It is possible that a connection count for an inactive node will be greater than 0 and in that case it will not be removed at the time of invalidation. However, later we don't have a mechanism to remove it, which means that it will stay in the hash. For this not to cause a problem, we use this udf in testing.copy/fix/clearPrepareCache
parent
8d8bc974ef
commit
10cd79a957
|
@ -110,7 +110,6 @@ static uint32 SharedConnectionHashHash(const void *key, Size keysize);
|
||||||
|
|
||||||
PG_FUNCTION_INFO_V1(citus_remote_connection_stats);
|
PG_FUNCTION_INFO_V1(citus_remote_connection_stats);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* citus_remote_connection_stats returns all the avaliable information about all
|
* citus_remote_connection_stats returns all the avaliable information about all
|
||||||
* the remote connections (a.k.a., connections to remote nodes).
|
* the remote connections (a.k.a., connections to remote nodes).
|
||||||
|
|
|
@ -117,6 +117,13 @@ SELECT pg_reload_conf();
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SET search_path TO ensure_no_shared_connection_leak;
|
SET search_path TO ensure_no_shared_connection_leak;
|
||||||
|
-- invalidate inactive shared connections
|
||||||
|
SELECT invalidate_inactive_shared_connections();
|
||||||
|
invalidate_inactive_shared_connections
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- ensure that we only have at most citus.max_cached_conns_per_worker
|
-- ensure that we only have at most citus.max_cached_conns_per_worker
|
||||||
-- connections per node
|
-- connections per node
|
||||||
select
|
select
|
||||||
|
|
|
@ -54,6 +54,9 @@ SELECT pg_reload_conf();
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SET search_path TO ensure_no_shared_connection_leak;
|
SET search_path TO ensure_no_shared_connection_leak;
|
||||||
|
|
||||||
|
-- invalidate inactive shared connections
|
||||||
|
SELECT invalidate_inactive_shared_connections();
|
||||||
|
|
||||||
-- ensure that we only have at most citus.max_cached_conns_per_worker
|
-- ensure that we only have at most citus.max_cached_conns_per_worker
|
||||||
-- connections per node
|
-- connections per node
|
||||||
select
|
select
|
||||||
|
|
Loading…
Reference in New Issue