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