Skip to content
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 #2467

Open
howels opened this issue Nov 29, 2022 · 1 comment
Open

Not honoring hugepages setting during initdb causes DB crash #2467

howels opened this issue Nov 29, 2022 · 1 comment

Comments

@howels
Copy link

howels commented Nov 29, 2022

Describe the bug
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 postgres.conf,sample instead of the actual specified configuration the applied setting is actually hugepages = 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.

To Reproduce
Run a DB with no hugepages resources assigned on a OS with hugepages and with hugepages = off set in postgres conf.

Expected behavior
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.

Additional context
Issue has persisted for some time and the implementation goes against the spirit of the configuration options provided. Exceedingly awkward workaround such as #1393 (comment) are not suitable for ongoing long-term usage.

@CyberDem0n
Copy link
Collaborator

This is outside of Patroni scope.
The initdb doesn't provide a way to disable huge pages.
Editing the sample.conf isn't an option either, Patroni simply doesn't have permissions for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants