Re: initdb / bootstrap design - Mailing list pgsql-hackers

From Andres Freund
Subject Re: initdb / bootstrap design
Date
Msg-id 20220216195049.lidcjzpgpoq5eypp@alap3.anarazel.de
Whole thread Raw
In response to Re: initdb / bootstrap design  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: initdb / bootstrap design  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: initdb / bootstrap design  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

On 2022-02-16 13:24:41 -0500, Tom Lane wrote:
> I remembered the reason why it's done that way: if we replaced those
> values during genbki.pl, the contents of postgres.bki would become
> architecture-dependent, belying its distribution as a "share" file.
> While we don't absolutely have to continue treating postgres.bki
> as architecture-independent, I'm skeptical that there's enough win
> here to justify a packaging change.

Hm. Architecturally I still would like to move it to be processed server
side. I'd like to eventually get rid of single user mode (but keep bootstrap,
at least for longer).

Seems we could make NAMEDATALEN, FLOAT8PASSBYVAL, ALIGNOF_POINTER,
FLOAT8PASSBYVAL stuff that bootparse knows about? And remove the need for
POSTGRES, ENCODING, LC_COLLATE, LC_CTYPE as discussed already?


> initdb is already plenty fast enough for any plausible production
> usage; it's cases like check-world where we wish it were faster.

It's not just our own usage though. I've seen it be a noticable time in test
suites of applications using postgres. And that's not really addressable with
the template approach, unless we want to move use of the template database
into initdb itself. I've thought about it, but then we'd need to do a lot more
than if it's just for our own tests.


> So I'm thinking what we really ought to pursue is the idea that's
> been kicked around more than once of capturing the post-initdb
> state of a cluster's files and just doing "cp -a" to duplicate that
> later in the test run.

Yea, we should pursue that independently of improving initdb's architecture /
speed. initdb will never be as fast as copying files around.

I kind of got stuck on how to deal with install.pl / vcregress.pl. For make
it's easy enough to create the template during during temp-install. But for
the msvc stuff is less clear when / where to create the template
database. Nearly everyone uses NO_TEMP_INSTALL on windows, because install is
so slow and happens in every test. But right now there's no command to create
the "temp" installation. Probably need something like a 'temp-install' command
for vcregress.pl and then convert the buildfarm to use that.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: Observability in Postgres
Next
From: Matthias van de Meent
Date:
Subject: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)