Re: A assert failure when initdb with track_commit_timestamp=on

From: Andy Fan <zhihuifan1213(at)163(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A assert failure when initdb with track_commit_timestamp=on
Date: 2025-07-02 01:38:18
Message-ID: 87ikkbmkxh.fsf@163.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:

Hi,

> On Wed, Jul 02, 2025 at 12:38:01AM +0000, Andy Fan wrote:
>> However this is not true in BootstrapMode, this failure is masked by
>> default because TransactionTreeSetCommitTsData returns fast when
>> track_commit_timestamp is off.
>
> Agreed that there is no point in registering a commit timestamp in
> the cases of a frozen and bootstrap XIDs. I would recommend to keep
> the assertion in TransactionIdSetCommitTs(), though, that still looks
> useful to me for the many callers of this routine, at least as a
> sanity check.

Yes, The assert also guard the InvalidTransactionId. So I removed this
solution in v2. Another reason for this is: if we allowed
BooststrapTransactionId in the commit_ts, it introduces something new to
this module when initdb with track_commit_timestamp=on. This risk might
be very low, but it can be avoided easily with the another solution.

>
> I did not check, but usually we apply filters based on
> IsBootstrapProcessingMode() for code paths that we do not want to
> reach while in bootstrap mode. Could the same be done here?

I think you are right. so I used IsBootstrapProcessingMode in v2.

--
Best Regards
Andy Fan

Attachment Content-Type Size
v2-0001-Don-t-record-commit_ts-in-bootstarp-mode.patch text/x-diff 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2025-07-02 01:51:52 Re: Inconsistent LSN format in pg_waldump output
Previous Message Richard Guo 2025-07-02 01:24:25 Re: Reduce "Var IS [NOT] NULL" quals during constant folding