pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix buffer usage stats for parallel nodes.
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix buffer usage stats for parallel nodes.
@ 2018-08-03 06:31  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Amit Kapila @ 2018-08-03 06:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix buffer usage stats for parallel nodes.

The buffer usage stats is accounted only for the execution phase of the
node.  For Gather and Gather Merge nodes, such stats are accumulated at
the time of shutdown of workers which is done after execution of node due
to which we missed to account them for such nodes.  Fix it by treating
nodes as running while we shut down them.

We can also miss accounting for a Limit node when Gather or Gather Merge
is beneath it, because it can finish the execution before shutting down
such nodes.  So we allow a Limit node to shut down the resources before it
completes the execution.

In the passing fix the gather node code to allow workers to shut down as
soon as we find that all the tuples from the workers have been retrieved.
The original code use to do that, but is accidently removed by commit
01edb5c7fc.

Reported-by: Adrien Nayrat
Author: Amit Kapila and Robert Haas
Reviewed-by: Robert Haas and Andres Freund
Backpatch-through: 9.6 where this code was introduced
Discussion: https://postgr.es/m/86137f17-1dfb-42f9-7421-82fd786b04a1@anayrat.info

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b805b63ac277d08beb0eac75469b867553d9a772

Modified Files
--------------
src/backend/executor/execProcnode.c | 17 +++++++++++++++++
src/backend/executor/nodeGather.c   |  3 +++
src/backend/executor/nodeLimit.c    |  2 ++
3 files changed, 22 insertions(+)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix buffer usage stats for parallel nodes.
@ 2018-08-03 06:31  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Amit Kapila @ 2018-08-03 06:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix buffer usage stats for parallel nodes.

The buffer usage stats is accounted only for the execution phase of the
node.  For Gather and Gather Merge nodes, such stats are accumulated at
the time of shutdown of workers which is done after execution of node due
to which we missed to account them for such nodes.  Fix it by treating
nodes as running while we shut down them.

We can also miss accounting for a Limit node when Gather or Gather Merge
is beneath it, because it can finish the execution before shutting down
such nodes.  So we allow a Limit node to shut down the resources before it
completes the execution.

In the passing fix the gather node code to allow workers to shut down as
soon as we find that all the tuples from the workers have been retrieved.
The original code use to do that, but is accidently removed by commit
01edb5c7fc.

Reported-by: Adrien Nayrat
Author: Amit Kapila and Robert Haas
Reviewed-by: Robert Haas and Andres Freund
Backpatch-through: 9.6 where this code was introduced
Discussion: https://postgr.es/m/86137f17-1dfb-42f9-7421-82fd786b04a1@anayrat.info

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dac7fe13bbf10c249a519d6a41c683c42c7e3312

Modified Files
--------------
src/backend/executor/execProcnode.c | 17 +++++++++++++++++
src/backend/executor/nodeGather.c   |  3 +++
src/backend/executor/nodeLimit.c    |  2 ++
3 files changed, 22 insertions(+)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix buffer usage stats for parallel nodes.
@ 2018-08-03 06:31  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Amit Kapila @ 2018-08-03 06:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix buffer usage stats for parallel nodes.

The buffer usage stats is accounted only for the execution phase of the
node.  For Gather and Gather Merge nodes, such stats are accumulated at
the time of shutdown of workers which is done after execution of node due
to which we missed to account them for such nodes.  Fix it by treating
nodes as running while we shut down them.

We can also miss accounting for a Limit node when Gather or Gather Merge
is beneath it, because it can finish the execution before shutting down
such nodes.  So we allow a Limit node to shut down the resources before it
completes the execution.

In the passing fix the gather node code to allow workers to shut down as
soon as we find that all the tuples from the workers have been retrieved.
The original code use to do that, but is accidently removed by commit
01edb5c7fc.

Reported-by: Adrien Nayrat
Author: Amit Kapila and Robert Haas
Reviewed-by: Robert Haas and Andres Freund
Backpatch-through: 9.6 where this code was introduced
Discussion: https://postgr.es/m/86137f17-1dfb-42f9-7421-82fd786b04a1@anayrat.info

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/85c9d3475e4f680dbca7c04fe096af018f3b8760

Modified Files
--------------
src/backend/executor/execProcnode.c | 17 +++++++++++++++++
src/backend/executor/nodeGather.c   |  3 +++
src/backend/executor/nodeLimit.c    |  2 ++
3 files changed, 22 insertions(+)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix buffer usage stats for parallel nodes.
@ 2018-08-03 06:31  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Amit Kapila @ 2018-08-03 06:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix buffer usage stats for parallel nodes.

The buffer usage stats is accounted only for the execution phase of the
node.  For Gather and Gather Merge nodes, such stats are accumulated at
the time of shutdown of workers which is done after execution of node due
to which we missed to account them for such nodes.  Fix it by treating
nodes as running while we shut down them.

We can also miss accounting for a Limit node when Gather or Gather Merge
is beneath it, because it can finish the execution before shutting down
such nodes.  So we allow a Limit node to shut down the resources before it
completes the execution.

In the passing fix the gather node code to allow workers to shut down as
soon as we find that all the tuples from the workers have been retrieved.
The original code use to do that, but is accidently removed by commit
01edb5c7fc.

Reported-by: Adrien Nayrat
Author: Amit Kapila and Robert Haas
Reviewed-by: Robert Haas and Andres Freund
Backpatch-through: 9.6 where this code was introduced
Discussion: https://postgr.es/m/86137f17-1dfb-42f9-7421-82fd786b04a1@anayrat.info

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/19df1702f5c5d5b7f1802e2a941b1a57ee47cc21

Modified Files
--------------
src/backend/executor/execProcnode.c | 17 +++++++++++++++++
src/backend/executor/nodeLimit.c    |  2 ++
2 files changed, 19 insertions(+)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-08-03 06:31 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-03 06:31 pgsql: Fix buffer usage stats for parallel nodes. Amit Kapila <akapila@postgresql.org>
2018-08-03 06:31 pgsql: Fix buffer usage stats for parallel nodes. Amit Kapila <akapila@postgresql.org>
2018-08-03 06:31 pgsql: Fix buffer usage stats for parallel nodes. Amit Kapila <akapila@postgresql.org>
2018-08-03 06:31 pgsql: Fix buffer usage stats for parallel nodes. Amit Kapila <akapila@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox