Re: BUG #17757: Not honoring huge_pages setting during initdb causes DB crash in Kubernetes

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, david_sisson(at)dell(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17757: Not honoring huge_pages setting during initdb causes DB crash in Kubernetes
Date: 2023-01-21 23:45:01
Message-ID: 20230121234501.b7b2skgbdw73ujvh@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2023-01-21 18:33:03 -0500, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2023-01-22 00:10:29 +0100, Tomas Vondra wrote:
> >> I doubt we want to just go straight to changing the default value for
> >> everyone. IMHO if the "try" logic is somehow broken, we should fix the
> >> try logic, not mess with the defaults.

> > Agreed. But we could disable huge pages explicitly inside initdb - there's
> > really no point in using it there...
>
> One of the things initdb is trying to do is establish a set of values
> that is known to allow the server to start. Not using the same settings
> that the server is expected to use would break that idea completely.

Yea, I'm not saying like the approach. OTOH, we don't provide a proper way to
influence the configuration, which is bad, as this issue shows.

Perhaps we should add an option to force MAP_POPULATE being used? I'm fairly
certain that'd avoid the SIGBUS in this case. And it'd make sense to ensure
that we can actually use the memory in initdb.

Unfortunately it's not unproblematic to use it in general, because with large
shared_buffers values it can be quite slow, because the kernel initializes the
memory in a single thread. I've seen ~3GB/s on multi-socket machines.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-01-22 00:08:01 Re: BUG #17757: Not honoring huge_pages setting during initdb causes DB crash in Kubernetes
Previous Message Tom Lane 2023-01-21 23:33:03 Re: BUG #17757: Not honoring huge_pages setting during initdb causes DB crash in Kubernetes