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

Update config.go #3555

Closed
wants to merge 1 commit into from
Closed

Conversation

David-Angel
Copy link

Another solution to the huge_pages issue here:
#3477

A better solution would be to use what gets passed in for huge_pages and turn it off by default.

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
  • [N/A] Have you added automated tests?

Type of Changes:

  • New feature
  • Bug fix
  • Documentation
  • Testing enhancement
  • Other

What is the current behavior (link to any open issues here)?
#3477

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)
    It should not break anything.

Other Information:

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.
@andrewlecuyer
Copy link
Collaborator

@David-Angel has this been tested successfully?

More specifically, I'd expect you to run into issues modifying the sample conf file due read-only root file system being enabled for the securityContext.

For instance, simply running the additional script you provided within a running PG instance Pod results in a read-only file system error:

$ kubectl exec -it hippo-instance1-kvr7-0 -c database -- bash
bash-4.4$ (
> echo "initdb fix for huge_pages."
> CSAMPLE="$(find /usr/ -type d -name 'pgsql-*')/share/postgresql.conf.sample"
> echo "$CSAMPLE"
> echo "before..."
> cat "$CSAMPLE" | grep huge
> awk -i inplace '($1 ~ /huge_pages/ || $1 ~ /#huge_pages/ || $2 ~ /huge_pagescat $CSAMPLE | grep huge/ || $2 ~ /#huge_pages/) { next } { print } END { print "huge_pages = off" }' ${CSAMPLE}
> echo "after..."
> cat "$CSAMPLE" | grep huge
> )
initdb fix for huge_pages.
/usr/pgsql-14/share/postgresql.conf.sample
before...
#huge_pages = try                       # on, off, or try
#huge_page_size = 0                     # zero for system default
awk: inplace:47: fatal: inplace_begin: mkstemp(`/usr/pgsql-14/share/postgresql.conf.sample.gawk.wtsq08') failed (Read-only file system)
after...
#huge_pages = try                       # on, off, or try
#huge_page_size = 0                     # zero for system default

@David-Angel
Copy link
Author

David-Angel commented Feb 1, 2023

o run into issues modifying the sample c

@andrewlecuyer
I will need to open a new PR.
I've been testing this for 2 days and yes it will need to be altered.
Security for the init container will have to be adjusted to get this to function.

It will work as this is the same fix I've made when we were using Bitnami
It would be much better if Crunchydata would accept the other fix within crunchy containers.

@David-Angel David-Angel closed this Feb 1, 2023
@David-Angel
Copy link
Author

A better solution is here:
CrunchyData/crunchy-containers#1502

@David-Angel
Copy link
Author

This solution did not work as the change made in the init container did not persist in the database container.
I was able to modify the files by altering the security settings but the changes were lost when the database container started.
I resolved this by replacing the file with a custom docker build.

This is still the best solution if approved by the Crunchydata team.
CrunchyData/crunchy-containers#1502

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

Successfully merging this pull request may close these issues.

2 participants