vitabaks / postgresql_cluster

Automated database platform for PostgreSQL® A modern, open-source alternative to cloud-managed databases.
https://postgresql-cluster.org
MIT License
1.83k stars 418 forks source link

Fix: Prevent division by zero in HugePages calculation #810

Closed vitabaks closed 2 days ago

vitabaks commented 3 days ago

Ensures huge_page_size has a valid value before performing division to prevent errors.

Added a fallback to use the default 2048 if huge_page_size is invalid or zero. Improves stability when calculating required HugePages for shared buffers.

Fixed:

TASK [pre-checks : HugePages | Calculate required HugePages] *******************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ZeroDivisionError: integer division or modulo by zero