Skip to content

Commit

Permalink
Fix: Prevent division by zero in HugePages calculation (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Nov 19, 2024
1 parent cacfacd commit 67a2127
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions automation/roles/pre-checks/tasks/huge_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@
ansible.builtin.set_fact:
huge_pages_required: >-
{{
((shared_buffers_gb | default(0) | int + (additional_huge_pages_gb | default(1)))
* 1024 * 1024) // huge_page_size.stdout | default(2048) | int
(
(shared_buffers_gb | default(0) | int
+ additional_huge_pages_gb | default(1))
* 1024 * 1024
)
// (huge_page_size.stdout | int if huge_page_size.stdout | int > 0 else 2048)
}}
when:
- shared_buffers_gb | default(0) | int >= (min_shared_buffers_gb | default(8))
Expand Down

0 comments on commit 67a2127

Please sign in to comment.