Re: Return value of XLogInsertRecord() for XLOG_SWITCH record

From: cca5507 <cca5507(at)qq(dot)com>
To: 반지현 <rring0727(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Return value of XLogInsertRecord() for XLOG_SWITCH record
Date: 2026-04-21 11:35:58
Message-ID: tencent_E61B19333CAD03393BB350CFC2EBDA879407@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, thanks for the test!

> One question:
> The original code did not apply MAXALIGN() to SizeOfXLogRecord before
> adding it. In practice SizeOfXLogRecord is likely already MAXALIGN'd
> (given typical record header layout), but could you confirm whether
> MAXALIGN() here is a correctness fix, a defensive no-op, or something
> that requires a separate note in the commit message?
>
> Otherwise the change looks good to me, and I think it's a reasonable
> cleanup.

I apply the MAXALIGN() to keep it consistent with ReserveXLogSwitch(), the
value seems unchanged though.

Attach v2 which is more efficient.

--
Regards,
ChangAo Chen

Attachment Content-Type Size
v2-0001-Keep-the-return-value-of-XLogInsertRecord-for-XLO.patch application/octet-stream 1.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Nikita Malakhov 2026-04-21 11:34:28 Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table