pull/7640/merge
Lucas Borges Fernandes 2025-06-24 12:33:48 -07:00 committed by GitHub
commit 13a0bd8ad6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 64 additions and 1 deletions

View File

@ -238,7 +238,7 @@ GetLocalSharedPoolSize(void)
{
if (LocalSharedPoolSize == ADJUST_POOLSIZE_AUTOMATICALLY)
{
return GetMaxClientConnections() * 0.5;
return GetMaxClientConnections();
}
return LocalSharedPoolSize;

View File

@ -2550,6 +2550,45 @@ SELECT pg_reload_conf();
t
(1 row)
/*
* test for the citus.local_shared_pool_size value when a regular user & superuser are querying it.
*/
ALTER SYSTEM SET citus.max_client_connections TO 80;
ALTER SYSTEM SET citus.local_shared_pool_size TO 0;
SELECT pg_reload_conf();
pg_reload_conf
---------------------------------------------------------------------
t
(1 row)
CREATE ROLE user_1 WITH LOGIN;
GRANT pg_read_all_settings TO user_1;
SET ROLE user_1;
/* should output 80, as this is the citus.max_client_connections value and a regular user is querying it. */
SHOW citus.local_shared_pool_size;
citus.local_shared_pool_size
---------------------------------------------------------------------
80
(1 row)
SET ROLE postgres;
/* should output 100, as this is the postgresql default for max_connections and the superuser is querying it. */
SHOW citus.local_shared_pool_size;
citus.local_shared_pool_size
---------------------------------------------------------------------
100
(1 row)
DROP ROLE user_1;
ALTER SYSTEM RESET citus.max_client_connections;
ALTER SYSTEM RESET max_connections;
ALTER SYSTEM RESET citus.local_shared_pool_size;
SELECT pg_reload_conf();
pg_reload_conf
---------------------------------------------------------------------
t
(1 row)
-- suppress notices
SET client_min_messages TO error;
-- cannot remove coordinator since a reference table exists on coordinator and no other worker nodes are added

View File

@ -1287,7 +1287,31 @@ ALTER SYSTEM RESET citus.distributed_deadlock_detection_factor;
ALTER SYSTEM RESET citus.local_shared_pool_size;
SELECT pg_reload_conf();
/*
* test for the citus.local_shared_pool_size value when a regular user & superuser are querying it.
*/
ALTER SYSTEM SET citus.max_client_connections TO 80;
ALTER SYSTEM SET citus.local_shared_pool_size TO 0;
SELECT pg_reload_conf();
CREATE ROLE user_1 WITH LOGIN;
GRANT pg_read_all_settings TO user_1;
SET ROLE user_1;
/* should output 80, as this is the citus.max_client_connections value and a regular user is querying it. */
SHOW citus.local_shared_pool_size;
SET ROLE postgres;
/* should output 100, as this is the postgresql default for max_connections and the superuser is querying it. */
SHOW citus.local_shared_pool_size;
DROP ROLE user_1;
ALTER SYSTEM RESET citus.max_client_connections;
ALTER SYSTEM RESET max_connections;
ALTER SYSTEM RESET citus.local_shared_pool_size;
SELECT pg_reload_conf();
-- suppress notices
SET client_min_messages TO error;