Re: Set arbitrary GUC options during initdb - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Set arbitrary GUC options during initdb
Date
Msg-id 1664499.1679516956@sss.pgh.pa.us
Whole thread Raw
In response to Re: Set arbitrary GUC options during initdb  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> This commit unfortunately broke --wal-segsize. If I use a slightly larger than
> the default setting, I get:
> initdb --wal-segsize 64 somepath
> running bootstrap script ... 2023-03-22 13:06:41.282 PDT [639848] FATAL:  "min_wal_size" must be at least twice
"wal_segment_size"

[ confused... ]  Oh, I see the problem.  This:

    /* set default max_wal_size and min_wal_size */
    snprintf(repltok, sizeof(repltok), "min_wal_size = %s",
             pretty_wal_size(DEFAULT_MIN_WAL_SEGS));
    conflines = replace_token(conflines, "#min_wal_size = 80MB", repltok);

looks like it's setting a compile-time-constant value of min_wal_size;
at least that's what I thought it was doing when I revised the code.
But it isn't, because somebody had the brilliant idea of making
pretty_wal_size() depend on the wal_segment_size_mb variable.

Will fix, thanks for report.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Set arbitrary GUC options during initdb
Next
From: Andres Freund
Date:
Subject: Re: HOT chain validation in verify_heapam()