Fix buffer usage stats for nodes above Gather Merge.
authorAmit Kapila
Sat, 25 Jul 2020 05:08:46 +0000 (10:38 +0530)
committerAmit Kapila
Sat, 25 Jul 2020 05:08:46 +0000 (10:38 +0530)
commitbdaa84e38932de43fca89b20a5078bf92ea356e4
tree68c3bb8147a9031cde0f18399d8110a16b5235c9
parent3d4a778152ecd8dc6815ce8b5525925bac446a99
Fix buffer usage stats for nodes above Gather Merge.

Commit 85c9d347 addressed a similar problem for Gather and Gather
Merge nodes but forgot to account for nodes above parallel nodes.  This
still works for nodes above Gather node because we shut down the workers
for Gather node as soon as there are no more tuples.  We can do a similar
thing for Gather Merge as well but it seems better to account for stats
during nodes shutdown after completing the execution.

Reported-by: Stéphane Lorek, Jehan-Guillaume de Rorthais
Author: Jehan-Guillaume de Rorthais 
Reviewed-by: Amit Kapila
Backpatch-through: 10, where it was introduced
Discussion: https://postgr.es/m/20200718160206.584532a2@firost
src/backend/executor/execProcnode.c