Re: pg_trgm comparison bug on cross-architecture replication due to different char implementation

Masahiko Sawada <sawada.mshk@gmail.com>

From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Noah Misch <noah@leadboat.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Joe Conway <mail@joeconway.com>, Peter Eisentraut <peter@eisentraut.org>, Alexander Korotkov <aekorotkov@gmail.com>, "Guo, Adam" <adamguo@amazon.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Nathan Bossart <nathandbossart@gmail.com>, Jim Mlodgenski <jimmy76@gmail.com>
Date: 2025-01-18T01:11:41Z
Lists: pgsql-hackers

Attachments

Hi,

I apologize for the late response. I completely missed tracking
updates on this thread.

On Tue, Nov 19, 2024 at 5:28 PM Noah Misch <noah@leadboat.com> wrote:
>
> On Thu, Oct 03, 2024 at 06:55:47AM -0700, Masahiko Sawada wrote:
> > I've attached PoC patches for the idea Noah proposed. Newly created
> > clusters unconditionally have default_char_signedness=true, and the
> > only source of signedness=false is pg_upgrade. To update the
> > signedness in the controlfile, pg_resetwal now has a new option
> > --char-signedness, which is used by pg_upgrade internally. Feedback is
> > very welcome.
>
> Upthread, we discussed testability.  Does pg_resetwal facilitate all
> appropriate testing, or do testing difficulties remain?

I think the new pg_resetwal facility to change the cluster's char
signedness is useful for testing. We can easily test cross
architecture replication from now on.

>
> I reviewed these patches, finding only one non-cosmetic review comment.  Given
> the PoC status, some of the observations below are likely ones you already
> know or would have found before exiting PoC.

Thank you for reviewing the patches. I agree with all the comments you
made. I've addressed them and I've attached new version patches that
now have some regression tests.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

Commits

  1. pg_upgrade: Check for the expected error message in TAP tests.

  2. Fix a typo in 005_char_signedness.pl test.

  3. Add test 005_char_signedness.pl to meson.build.

  4. Fix an issue with index scan using pg_trgm due to char signedness on different architectures.

  5. pg_upgrade: Add --set-char-signedness to set the default char signedness of new cluster.

  6. pg_upgrade: Preserve default char signedness value from old cluster.

  7. pg_resetwal: Add --char-signedness option to change the default char signedness.

  8. Add default_char_signedness field to ControlFileData.

  9. Remove unneeded nbtree array preprocessing assert.