On Tue, Aug 04, 2026 at 03:57:47PM +0800, Xuneng Zhou wrote: > After some discussions/debates with Sol, it offers a copying > alternative for fixing the issue: > > HashMetaPageData local_metapage; > > cachedmetap = _hash_getcachedmetap(rel, ...); > memcpy(&local_metapage, cachedmetap, sizeof(local_metapage)); > > /* May invalidate and free rd_amcache. */ > some_catalog_access(); > > use(&local_metapage); /* still allocated */ > > I don't have a strong opinion over them yet. Just putting it on the > table in case the game is over before putting my thoughts together.
Sol is an agent, you are free to use it but I tend to take such automated opinions with a grain of salt, as knowing the internals avoids a lot of AI noise. I am not sure that I see the point of a copy if we make the read initialization happen before we retrieve the cached page so as there is no interference with invalidation messages, so tweaked a bit the comment, and applied the fix down to v19. -- Michael
signature.asc
Description: PGP signature
