vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.69k stars 411 forks source link

pgbouncer: Update pool size calculation algorithm #362

Closed vitabaks closed 1 year ago

vitabaks commented 1 year ago

Update pool size calculation algorithm and add comprehensive code comments.

This PR addresses an issue with the calculation of the total size of pools in the pgbouncer configuration. The previous implementation had a flaw that resulted in incorrect pool size calculations. In this PR, the algorithm for calculating the pool size has been fixed to calculate the sum of the pool sizes accurately.

Additionally, this PR introduces detailed comments throughout the codebase. The comments provide clear explanations of the logic and purpose of each task, making the code more maintainable and easier to understand for future contributors.

The changes in this PR enhance the reliability and readability of the pgbouncer configuration code, ensuring accurate pool size calculations and facilitating smoother maintenance in the future.