Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array

From: Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>
To: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Kirill Reshke <reshkekirill(at)gmail(dot)com>
Subject: Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
Date: 2026-01-08 08:48:51
Message-ID: CAA3qoJn+Ac5L796-JdorxDNajfEvvCrXVLDUnsjtcbDukPTMqw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Xuneng,

On Thu, Jan 8, 2026 at 4:15 PM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:

>
> v3-0001 fixes a critical issue where the snapshot->xip array in
> SnapBuildBuildSnapshot might not be sorted before reaching the
> consistent state. Sorry for the noise here.
>
>
I’ve given this patch a cursory review, and it looks good overall.
Considering the impact of this change, should we add a regression test for
it, or provide a unit test to ensure the correctness of the modification?
I think it would be more receptive to merging such a "subtle performance
optimization" only when its correctness is fully guaranteed.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2026-01-08 09:15:30 Re: Add GoAway protocol message for graceful but fast server shutdown/switchover
Previous Message zengman 2026-01-08 08:43:46 Re: [PATCH] Fix typo in pgstat_replslot.c