-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not honoring hugepages setting during initdb causes DB crash #3477
Comments
Note that we are aware of #3039 but this is a workaround not a solution. HugePages should only be used by apps which explicity require hugepages. |
Bug also mentioned in #3421 |
The workaround to enable hugepages isn't going to work when you are required to disable hugepages. This file needs to change to turn it off. initdb uses that file instead of the standard config file. |
Can we please get a response on this? |
This is a temporary solution for this issue: CrunchyData/postgres-operator#3477 It turns off hugepages in the "postgresql.conf.sample" sample file.
Here is a possible fix: This has become a critical issue for us as we are unable to build the crunchy containers to make the customization. That fix might be valid in every case. |
When the system has huge_pages turned on initdb is using the "postgresql.conf.sample" file causing the process to crash in Kubernetes. Turning off huge pages in this file would resolve the issue. Here are some links for further information Crunchydata CrunchyData/postgres-operator#3477 CrunchyData/postgres-operator#3039 CrunchyData/postgres-operator#2258 CrunchyData/postgres-operator#3126 CrunchyData/postgres-operator#3421 Bitnami bitnami/charts#7901
I've verified with PostgreSQL support. Conversation with PostgreSQL |
Another solution to the huge_pages issue here: CrunchyData#3477 A better solution would be to use what gets passed in for huge_pages and turn it off by default.
Here is another solution: |
This may be resolved in the latest build by Crunchydata as they updated their documentation to say it is now disabled by default. |
As @David-Angel has indicated, this issue has been resolved in our latest releases: 5.4.0, 5.3.2, 5.2.3, and 5.1.6. |
Overview
On an OS where hugepages are enabled, if no hugepages resources are assigned in Kubernetes and the postgres instance is set to
hugepages = off
in the config then one would assume that the DB would not use hugepages.However, because the initdb process uses
postgresql.conf.sample
orpostgresql.conf.template
instead of the actual specified configuration the applied setting is actuallyhugepages = try
during initdb.In these case the initdb phase will attempt to allocate hugepages which are available in the OS, but it will be denied access by Kubernetes and fail.
Environment
Steps to Reproduce
Run a DB with no hugepages resources assigned on a OS with hugepages and with
hugepages = off
set in postgres conf.Expected
When hugepages are disabled they should not be used, during initdb or otherwise. The inability to specify hugepages forces all DBs to use hugepages on any system where they are enabled, even if the hugepages are intended for other applications and not available to the DB Pods.
Actual
Postgres crashes during initdb after speculatively attempting to access hugepages and being denied by Kubernetes policies.
Additional Information
Issue has persisted for some time and the implementation goes against the spirit of the configuration options provided. Exceedingly awkward workaround such as attempting to mount configmaps over
postgresql.conf.sample
are not suitable for ongoing long-term usage.The text was updated successfully, but these errors were encountered: