| From: | Xuneng Zhou <xunengzhou(at)gmail(dot)com> |
|---|---|
| To: | Michael Paquier <michael(at)paquier(dot)xyz> |
| Cc: | Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Streamify more code paths |
| Date: | 2026-08-05 11:39:02 |
| Message-ID: | CABPTF7UWe9yvJDDb==iwuQ4iWa14CdbzcGtpdzr6hF=PA+ARDw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Michael,
On Wed, Aug 5, 2026 at 4:00 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> 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 agree with you. The output of Sol or other AI should not be believed
without proper audit. As any tool, the people using it should take the
responsibility and make the judgement. Sorry for posting the lines
prematurely before grasping it well.
> 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.
It took me a while to understand vaguely what happened here as I am
not very familiar with the invalidation and cache mechanism here. That
said, the fix LGTM from correctness perspective since Sol has run &
passed its reproducer and the supplied test before. Thanks for
applying. I'll reply later to express my thoughts better.
--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Aleksander Alekseev | 2026-08-05 11:40:33 | Re: [PATCH] Add tests for src/backend/nodes/extensible.c |
| Previous Message | Amit Kapila | 2026-08-05 11:29:58 | Re: Proposal: Conflict log history table for Logical Replication |