Re: Fix BUG #17335: Duplicate result rows in Gather node - Mailing list pgsql-hackers

From David Rowley
Subject Re: Fix BUG #17335: Duplicate result rows in Gather node
Date
Msg-id CAApHDvrpA_Xes_m81a1MBJ5RVchkummCGEc3-tBkjg0o+ektEQ@mail.gmail.com
Whole thread Raw
In response to Fix BUG #17335: Duplicate result rows in Gather node  (Yura Sokolov <y.sokolov@postgrespro.ru>)
Responses Re: Fix BUG #17335: Duplicate result rows in Gather node
List 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



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Speed up transaction completion faster after many relations are accessed in a transaction
Next
From: Zhihong Yu
Date:
Subject: Re: Speed up transaction completion faster after many relations are accessed in a transaction