| From: | "Yilin Zhang" <jiezhilove(at)126(dot)com> |
|---|---|
| To: | "Rafia Sabih" <rafia(dot)pghackers(at)gmail(dot)com> |
| Cc: | "Robert Haas" <robertmhaas(at)gmail(dot)com>, "KENAN YILMAZ" <kenan(dot)yilmaz(at)localus(dot)com(dot)tr>, "Andy Fan" <zhihuifan1213(at)163(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re:Re: Bypassing cursors in postgres_fdw to enable parallel plans |
| Date: | 2026-07-02 07:02:37 |
| Message-ID: | 48523e54.4f23.19f21a2fe22.Coremail.jiezhilove@126.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
At 2026-06-29 17:27:17,"Rafia Sabih" <rafia(dot)pghackers(at)gmail(dot)com> wrote :
>I understand your concern and I tried to solve it by passing fsstate now,
>also saving a backpointer to the node in active_fsstate to solve the issue
>with make_tuple_from_result_row. Since we need to have conn from fsstate, I
>am not sure how we can do that if we have only active_fsstate passed to the
>function.
I have reviewed all your previous patch revisions and tested the v12 patch.
You have fixed the issue raised by Robert where active_scan was not cleared when it ought to have been.
However, in my opinion, active_scan is cleared prematurely before the drain loop finishes executing.
If an error occurs mid-drain (such as query cancellation), the connection remains in an in-flight query state with no active_scan referencing it.
In the subsequent postgresEndForeignScan, is_active_scan() will return false, so pgfdw_cancel_scan() will never be invoked.
In subsequent queries, conn_state->active_scan may become a dangling pointer, triggering a crash.
I have written a test case that reproduces this crash to confirm the bug.
Best regards,
--
Yilin Zhang
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Xuneng Zhou | 2026-07-02 07:02:38 | Re: Update EnableTimeoutParams timeout type comment |
| Previous Message | Peter Eisentraut | 2026-07-02 07:02:35 | Re: FOR PORTION OF should reject GENERATED columns |