Fix oversight in commit 1ec7fca8592178281cd5cdada0f27a340fb813fc.
authorEtsuro Fujita <efujita@postgresql.org>
Mon, 2 Aug 2021 03:45:01 +0000 (12:45 +0900)
committerEtsuro Fujita <efujita@postgresql.org>
Mon, 2 Aug 2021 03:45:01 +0000 (12:45 +0900)
commitfb234086fe81fb1848934b6e1f6382611fc9ad4f
treeefdef28948bf4ac7f5ec6783ac1c636535eb0f52
parentec410c985e6d360f666e39be5609f3c4da5edc8f
Fix oversight in commit 1ec7fca8592178281cd5cdada0f27a340fb813fc.

I failed to account for the possibility that when
ExecAppendAsyncEventWait() notifies multiple async-capable nodes using
postgres_fdw, a preceding node might invoke process_pending_request() to
process a pending asynchronous request made by a succeeding node.  In
that case the succeeding node should produce a tuple to return to the
parent Append node from tuples fetched by process_pending_request() when
notified.  Repair.

Per buildfarm via Michael Paquier.  Back-patch to v14, like the previous
commit.

Thanks to Tom Lane for testing.

Discussion: https://postgr.es/m/YQP0UPT8KmPiHTMs%40paquier.xyz
contrib/postgres_fdw/postgres_fdw.c
src/backend/executor/nodeAppend.c