Re: Assertion failure during initdb with transaction_timeout set

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-07-04T14:47:26Z
Lists: pgsql-hackers
Fujii Masao <masao.fujii@oss.nttdata.com> writes:
> While discussing the assertion failure with track_commit_timestamp=on during initdb [1],
> I found a similar issue with another GUC: transaction_timeout.

> This happens because enable_timeout() tries to start the transaction timeout
> before InitializeTimeouts() has been called, i.e., the timeout subsystem
> hasn't been initialized yet.

> To address this, I'm thinking forcibly setting transaction_timeout to 0
> during bootstrap or in initdb.

I don't like inventing a different workaround for each case we find.
The precedent established by the other patch is to prevent the
relevant subsystem from starting if IsBootstrapProcessingMode().
Can't we do something similar here?

			regards, tom lane