Re: Potential ABI breakage in upcoming minor releases - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Potential ABI breakage in upcoming minor releases
Date
Msg-id ZzcR+oQmUOIm6RVF@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Potential ABI breakage in upcoming minor releases  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
Hi,

On Thu, Nov 14, 2024 at 11:35:25AM -0500, Peter Geoghegan wrote:
> On Thu, Nov 14, 2024 at 11:29 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> > ISTM that we have spare bytes where we could place that boolean without
> > breaking ABI.  In x86_64 there's a couple of 4-byte holes, but those
> > won't be there on x86, so not great candidates.  Fortunately there are
> > 3-byte and 7-byte holes also, which we can use safely.  We can move the
> > new boolean to those location.
> 
> Wasn't this part of the official guidelines?

Do you mean in [1] (Maintaining ABI compatibility while backpatching section)?

If so, it looks like it's not currently mentioned.

What about?

"
You cannot modify any struct definition in src/include/*. If any new members must
be added to a struct, put them in the padding holes (if any) in backbranches (or
at the end of the struct if there is no padding holes available).
"

Also we may need a decision table to ensure 32-bit portability based on the
hole size on 64-bit, something like?

64-bit hole size | use on 32-bit?
-----------------|---------------
<=3 bytes        | safe to use
4 bytes          | don't use
5-7 bytes        | use first (hole_size - 4) bytes only

Does that make sense?

Regards,

[1]: https://wiki.postgresql.org/wiki/Committing_checklist

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: general purpose array_sort
Next
From: Amit Kapila
Date:
Subject: Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description