citus/src/backend/distributed/test
Onder Kalaci 629ecc3dee Add the infrastructure to count the number of client backends
Considering the adaptive connection management
improvements that we plan to roll soon, it makes it
very helpful to know the number of active client
backends.

We are doing this addition to simplify yhe adaptive connection
management for single node Citus. In single node Citus, both the
client backends and Citus parallel queries would compete to get
slots on Postgres' `max_connections` on the same Citus database.

With adaptive connection management, we have the counters for
Citus parallel queries. That helps us to adaptively decide
on the remote executions pool size (e.g., throttle connections
if necessary).

However, we do not have any counters for the total number of
client backends on the database. For single node Citus, we
should consider all the client backends, not only the remote
connections that Citus does.

Of course Postgres internally knows how many client
backends are active. However, to get that number Postgres
iterates over all the backends. For examaple, see [pg_stat_get_db_numbackends](8e90ec5580/src/backend/utils/adt/pgstatfuncs.c (L1240))
where Postgres iterates over all the backends.

For our purpuses, we need this information on every connection
establishment. That's why we cannot affort to do this kind of
iterattion.
2020-11-25 19:19:24 +01:00
..
backend_counter.c Add the infrastructure to count the number of client backends 2020-11-25 19:19:24 +01:00
colocation_utils.c Replace foreach with foreach_ptr/foreach_oid (#3544) 2020-02-27 16:54:49 +01:00
create_shards.c Replace foreach with foreach_ptr/foreach_oid (#3544) 2020-02-27 16:54:49 +01:00
deparse_function_query.c Automatically convert useless declarations using regex replace (#3181) 2019-11-21 13:47:29 +01:00
deparse_shard_query.c Remove master from file hierarchy 2020-06-16 17:49:09 +02:00
distributed_deadlock_detection.c remove copyright years (#3286) 2019-12-11 21:14:08 +03:00
distributed_intermediate_results.c Introduce cache entry/table utilities (#4132) 2020-09-02 22:26:05 +03:00
distribution_metadata.c Fix int32 overflow and use PG macros for INT32_XX (#4061) 2020-07-23 18:30:08 +03:00
fake_am.c Table access method support for distributed tables 2020-10-16 12:02:25 -07:00
fake_fdw.c use macros for pg versions instead of hardcoded values (#3694) 2020-04-01 17:01:52 +03:00
file_utils.c Remove master from file hierarchy 2020-06-16 17:49:09 +02:00
foreign_key_relationship_query.c adapt recently added code for pg13 2020-08-04 15:18:27 +03:00
intermediate_results.c Rename ForceXxx functions to to XxxOrError 2020-09-01 11:19:17 +02:00
metadata_sync.c rename node/worker utilities (#4003) 2020-07-09 15:30:35 +03:00
partitioning_utils.c Replace foreach with foreach_ptr/foreach_oid (#3544) 2020-02-27 16:54:49 +01:00
progress_utils.c Replace foreach with foreach_ptr/foreach_oid (#3544) 2020-02-27 16:54:49 +01:00
prune_shard_list.c Remove master from file hierarchy 2020-06-16 17:49:09 +02:00
relation_access_tracking.c remove copyright years (#3286) 2019-12-11 21:14:08 +03:00
run_from_same_connection.c Remove task tracker executor (#3850) 2020-07-18 13:11:36 +03:00
sequential_execution.c Remove copyright years (#2918) 2019-10-15 17:44:30 +03:00
shared_connection_counters.c Throttle connections to the worker nodes 2020-04-14 10:27:48 +02:00
xact_stats.c Fix Subtransaction memory leak 2020-07-09 12:33:39 -07:00