Re: BUG #17757: Not honoring huge_pages setting during initdb causes DB crash in Kubernetes
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: "Sisson, David" <David.Sisson@dell.com>,
Tomas Vondra <tomas.vondra@enterprisedb.com>,
"pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2023-01-23T22:51:46Z
Lists: pgsql-bugs
Attachments
- override-config-options-during-initdb-0.1.patch (text/x-diff) patch
Andres Freund <andres@anarazel.de> writes: > It's a fault of the environment if mmap(MAP_HUGETLB) causes a SIGBUS. Normally > huge_pages = try is harmless, because it'll just fall back. That source of > SIGBUSes needs to be fixed regardless of anything else - plenty allocators try > to use huge pages for example, so you'll run into problems regardless of > postgres' default. That seems likely to me too. > That said, I'm for allowing to specify options to initdb. Yeah, I think that has enough other potential applications to be worth doing. Here's a quick draft patch (sans user-facing docs as yet). It injects any given values into postgresql.auto.conf, not postgresql.conf proper. I did that mainly because the latter looked beyond the abilities of the primitive string-munging code we have in there, but I think it can be argued to be a reasonable choice anyway. regards, tom lane