pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Consider parallel awareness when removing single-child Appends
4+ messages / 1 participants
[nested] [flat]

* pgsql: Consider parallel awareness when removing single-child Appends
@ 2022-01-25 08:10  David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: David Rowley @ 2022-01-25 08:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Consider parallel awareness when removing single-child Appends

8edd0e794 added some code to remove Append and MergeAppend nodes when they
contained a single child node.  As it turned out, this was unsafe to do
when the Append/MergeAppend was parallel_aware and the child node was not.
Removing the Append/MergeAppend, in this case, could lead to the child plan
being called multiple times by parallel workers when it was unsafe to do
so.

Here we fix this by just not removing the Append/MergeAppend when the
parallel_aware flag of the parent and child node don't match.

Reported-by: Yura Sokolov
Bug: #17335
Discussion: https://postgr.es/m/b59605fecb20ba9ea94e70ab60098c237c870628.camel%40postgrespro.ru
Backpatch-through: 12, where 8edd0e794 was first introduced

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/plan/setrefs.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)



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

* pgsql: Consider parallel awareness when removing single-child Appends
@ 2022-01-25 08:14  David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: David Rowley @ 2022-01-25 08:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Consider parallel awareness when removing single-child Appends

8edd0e794 added some code to remove Append and MergeAppend nodes when they
contained a single child node.  As it turned out, this was unsafe to do
when the Append/MergeAppend was parallel_aware and the child node was not.
Removing the Append/MergeAppend, in this case, could lead to the child plan
being called multiple times by parallel workers when it was unsafe to do
so.

Here we fix this by just not removing the Append/MergeAppend when the
parallel_aware flag of the parent and child node don't match.

Reported-by: Yura Sokolov
Bug: #17335
Discussion: https://postgr.es/m/b59605fecb20ba9ea94e70ab60098c237c870628.camel%40postgrespro.ru
Backpatch-through: 12, where 8edd0e794 was first introduced

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/357ff66153b4791d32c45724d8a0d3c91d89c937

Modified Files
--------------
src/backend/optimizer/plan/setrefs.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)



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

* pgsql: Consider parallel awareness when removing single-child Appends
@ 2022-01-25 08:15  David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: David Rowley @ 2022-01-25 08:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Consider parallel awareness when removing single-child Appends

8edd0e794 added some code to remove Append and MergeAppend nodes when they
contained a single child node.  As it turned out, this was unsafe to do
when the Append/MergeAppend was parallel_aware and the child node was not.
Removing the Append/MergeAppend, in this case, could lead to the child plan
being called multiple times by parallel workers when it was unsafe to do
so.

Here we fix this by just not removing the Append/MergeAppend when the
parallel_aware flag of the parent and child node don't match.

Reported-by: Yura Sokolov
Bug: #17335
Discussion: https://postgr.es/m/b59605fecb20ba9ea94e70ab60098c237c870628.camel%40postgrespro.ru
Backpatch-through: 12, where 8edd0e794 was first introduced

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/optimizer/plan/setrefs.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)



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

* pgsql: Consider parallel awareness when removing single-child Appends
@ 2022-01-25 08:16  David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: David Rowley @ 2022-01-25 08:16 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Consider parallel awareness when removing single-child Appends

8edd0e794 added some code to remove Append and MergeAppend nodes when they
contained a single child node.  As it turned out, this was unsafe to do
when the Append/MergeAppend was parallel_aware and the child node was not.
Removing the Append/MergeAppend, in this case, could lead to the child plan
being called multiple times by parallel workers when it was unsafe to do
so.

Here we fix this by just not removing the Append/MergeAppend when the
parallel_aware flag of the parent and child node don't match.

Reported-by: Yura Sokolov
Bug: #17335
Discussion: https://postgr.es/m/b59605fecb20ba9ea94e70ab60098c237c870628.camel%40postgrespro.ru
Backpatch-through: 12, where 8edd0e794 was first introduced

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2ccd8fb29d74f91b291be20df43f9c0194642ae8

Modified Files
--------------
src/backend/optimizer/plan/setrefs.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)



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


end of thread, other threads:[~2022-01-25 08:16 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 08:10 pgsql: Consider parallel awareness when removing single-child Appends David Rowley <drowley@postgresql.org>
2022-01-25 08:14 pgsql: Consider parallel awareness when removing single-child Appends David Rowley <drowley@postgresql.org>
2022-01-25 08:15 pgsql: Consider parallel awareness when removing single-child Appends David Rowley <drowley@postgresql.org>
2022-01-25 08:16 pgsql: Consider parallel awareness when removing single-child Appends David Rowley <drowley@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