pgsql: Make FastPathMeta self-contained by copying FmgrInfo structs - Mailing list pgsql-committers

From Amit Langote
Subject pgsql: Make FastPathMeta self-contained by copying FmgrInfo structs
Date
Msg-id E1w7sB9-002RNA-1Z@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Make FastPathMeta self-contained by copying FmgrInfo structs

FastPathMeta stored pointers into ri_compare_cache entries via
compare_entries[], creating a dependency on that cache remaining
stable.  If ri_compare_cache entries were invalidated after fpmeta
was populated, the pointers would dangle.

Replace compare_entries[] with inline copies of the two FmgrInfo
fields actually needed (cast_func_finfo and eq_opr_finfo), copied
at populate time via fmgr_info_copy().  fpmeta now depends only on
riinfo remaining valid, which is already handled by the invalidation
callback.

Introduced by commit 2da86c1ef9 ("Add fast path for foreign key
constraint checks"), noticed while reviewing code for robustness
under CLOBBER_CACHE_ALWAYS.

Discussion: https://postgr.es/m/CA+HiwqFQ+ZA7hSOygv4uv_t75B3r0_gosjadetCsAEoaZwTu6g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/edee5634564d5f9fae4c3a10ee3182de338ed07e

Modified Files
--------------
src/backend/utils/adt/ri_triggers.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)


pgsql-committers by date:

Previous
From: Amit Langote
Date:
Subject: Re: pgsql: Add fast path for foreign key constraint checks
Next
From: Andres Freund
Date:
Subject: pgsql: aio: io_uring: Allow IO methods to check if IO completed in the