Re: Fix BUG #17335: Duplicate result rows in Gather node
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Yura Sokolov <y.sokolov@postgrespro.ru>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2022-01-01T02:19:18Z
Lists: pgsql-hackers
On Fri, 31 Dec 2021 at 00:14, Yura Sokolov <y.sokolov@postgrespro.ru> wrote: > Problem: > - Append path is created with explicitely parallel_aware = true > - It has two child, one is trivial, other is parallel_aware = false . > Trivial child is dropped. > - Gather/GatherMerge path takes Append path as a child and thinks > its child is parallel_aware = true. > - But Append path is removed at the last since it has only one child. > - Now Gather/GatherMerge thinks its child is parallel_aware, but it > is not. > Gather/GatherMerge runs its child twice: in a worker and in a leader, > and gathers same rows twice. Thanks for the report. I can confirm that I can recreate the problem with your script. I will look into this further later next week. David
Commits
-
Consider parallel awareness when removing single-child Appends
- 2ccd8fb29d74 12.10 landed
- f8807e7742e5 13.6 landed
- 357ff66153b4 14.2 landed
- f9a74c1498d2 15.0 landed
-
Suppress Append and MergeAppend plan nodes that have a single child.
- 8edd0e79460b 12.0 cited