citus
citus copied to clipboard
Fixing default citus.local_shared_pool_size calculation
Description:
This PR fixes the default calculation for citus.local_shared_pool_size when a value is not set for the GUC.
The original approach was to divide citus.client_max_connections by 2, which could lead to errors even when there is enough room for new loopback connections.
Example:
Assuming citus.client_max_connections = 80 and the current active client backend count is 40, the following line would create an error if the new loopback connection issuer were not a superuser:
https://github.com/citusdata/citus/blob/main/src/backend/distributed/connection/shared_connection_stats.c#L383-L386