From: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
---|---|
To: | Amit Langote <amitlangote09(at)gmail(dot)com> |
Cc: | Tender Wang <tndrwang(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, tharakan(at)gmail(dot)com |
Subject: | Re: BUG #18830: ExecInitMerge Segfault on MERGE |
Date: | 2025-03-16 09:57:01 |
Message-ID: | CAEZATCXQRPKGQr6rsY3j3WX3=Jqc1nc4YFUeq_OB8T7=DH8PFQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Fri, 14 Mar 2025 at 02:48, Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>
> That said, my concern remains that taking any new locks during
> ExecInitNode() risks triggering CachedPlan validation logic that we’ve
> intentionally avoided dealing with, as per 525392d5727f. Even if this
> particular usage might not trip over it, it still feels like we’re
> stepping into a sensitive area. So I’d prefer to keep the locking in
> ExecDoInitialPruning(), where interacting with plan invalidation is
> expected and safe — and we don’t risk leaving the executor in a
> partially initialized state.
>
OK, I think that makes sense. Trapping any plan invalidations early,
after ExecDoInitialPruning(), and before initialising the rest of the
executor state does seem preferable for that reason.
I have a couple of comments on the v3 patch:
* In ExecInitModifyTable(), it's possible to avoid code duplication. I
think that's worth it to make the code more maintainable if more
per-result relation logic is added in the future.
* In executor.h, the name of the new function argument doesn't match
the .c source file.
* In ExecDoInitialPruning(), there is room for improvement: we
actually only need to lock the first result relation if all other
result relations of the ModifyTable node have been pruned. As it
stands, there's no easy way to tell that, so I've just made a note of
it in a comment. I wondered about replacing the new field
"firstResultRels" with something like "mtResultRels", which would be a
list of lists, to allow that, but I didn't try it.
I'm attaching v4, which addresses those comments, and includes a few
other comment update suggestions.
Regards,
Dean
Attachment | Content-Type | Size |
---|---|---|
v4-Do-not-allow-all-ModifyTable-result-relations-to-be-pruned.patch | text/x-patch | 17.3 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | PG Bug reporting form | 2025-03-16 13:39:16 | BUG #18852: Unexpected expression in subquery output |
Previous Message | Tom Lane | 2025-03-15 21:35:57 | Re: ISN extension - wrong volatility level for isn_weak() function |