Re: bug: Gather rescan keeps the first scan's tuple bound in workers

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: bug: Gather rescan keeps the first scan's tuple bound in workers
Date: 2026-09-19 03:05:45
Message-ID: CAGRkXqRGE+TwD0Ttmb4b1J8Vy-drrkZYhh6hOf2_Uz5XKtXsEA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Jeff,

Thanks for reporting this bug.

I can reproduce this on master, and a 1000 row table is enough.
The attached 0001 adds a tuples_needed argument to
ExecParallelReinitialize() and stores it in the shared state, the same
way ExecInitParallelPlan() does. 0002 is a regression test and is
optional.

For the back branches this changes the signature of an exported
function. I don't know of any extension that calls it, but if that is
a concern, a new function could set the bound there instead.

Thanks,
Shihao

Attachment Content-Type Size
v1-0001-Pass-the-current-tuple-bound-to-workers-on-Gather.patch application/octet-stream 4.1 KB
v1-0002-Add-test-for-Gather-rescan-with-a-changing-tuple-.patch application/octet-stream 3.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message shihao zhong 2026-09-19 03:19:51 Re: JSON_SERIALIZE for JSONB returns parts of the internal JSONB representation
Previous Message Srinath Reddy Sadipiralla 2026-09-19 00:58:37 Re: BUG #19695: JSON_VALUE ... RETURNING jsonb returns NULL for later evaluation once one evaluation returns NULL