Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array - Mailing list pgsql-hackers

From Neil Chen
Subject Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
Date
Msg-id CAA3qoJn+Ac5L796-JdorxDNajfEvvCrXVLDUnsjtcbDukPTMqw@mail.gmail.com
Whole thread Raw
In response to Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array  (Xuneng Zhou <xunengzhou@gmail.com>)
Responses Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
List pgsql-hackers
Hi Xuneng,

On Thu, Jan 8, 2026 at 4:15 PM Xuneng Zhou <xunengzhou@gmail.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.

pgsql-hackers by date:

Previous
From: "zengman"
Date:
Subject: Re: [PATCH] Fix typo in pgstat_replslot.c
Next
From: "Jelte Fennema-Nio"
Date:
Subject: Re: Add GoAway protocol message for graceful but fast server shutdown/switchover