Re: Explain buffers wrong counter with parallel plans

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Adrien Nayrat <adrien.nayrat@anayrat.info>, Andres Freund <andres@anarazel.de>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2018-06-06T16:08:40Z
Lists: pgsql-hackers
On 2018-May-07, Robert Haas wrote:

> On Sat, May 5, 2018 at 8:56 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> > The reason why I think the current behavior is okay because it is
> > coincidental that they were displayed correctly.  We have not made any
> > effort to percolate it to upper nodes.  For ex., before that commit
> > also, it was not being displayed for Gather Merge or Gather with some
> > kind of node like 'Limit' where we have to stop before reaching the
> > end of the result.
> 
> It's not entirely coincidental.  I had the intention to try to ensure
> that the workers would be shut down before the Gather or Gather Merge,
> and I think that various things in the code testify to that intention.
> It sounds like I missed some cases, but now we're missing even more
> cases.

So, apparently this is not a Postgres 11 open item, but rather a bug
that goes back to pg10.  However, maybe it would be worth fixing soon
anyway?  In particular, if we want to perturb the explain output as
suggested upthread, maybe *that* should be considered an open item?

Anyway, this has stalled for a month now.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. Adjust comment atop ExecShutdownNode.

  2. Prohibit shutting down resources if there is a possibility of back up.

  3. Fix buffer usage stats for parallel nodes.

  4. Match the buffer usage tracking for leader and worker backends.

  5. Improve division of labor between execParallel.c and nodeGather[Merge].c.