Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCOkM-0003Yy-0E for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 16:32:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCOkK-0006kx-GZ for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 16:32:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCOkK-0006ko-6U for pgsql-hackers@lists.postgresql.org; Tue, 25 Jan 2022 16:32:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCOkH-0002ls-RG for pgsql-hackers@lists.postgresql.org; Tue, 25 Jan 2022 16:32:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 20PGWZxF2258971; Tue, 25 Jan 2022 11:32:35 -0500 From: Tom Lane To: Yura Sokolov cc: David Rowley , PostgreSQL Developers Subject: Re: Fix BUG #17335: Duplicate result rows in Gather node In-reply-to: <379609b13ed86654d40521eca5dd7984a238a1c7.camel@postgrespro.ru> References: <382c3b52071a087fd4357e22959b3ddb05e524b7.camel@postgrespro.ru> <379609b13ed86654d40521eca5dd7984a238a1c7.camel@postgrespro.ru> Comments: In-reply-to Yura Sokolov message dated "Tue, 25 Jan 2022 12:29:07 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2258969.1643128355.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 25 Jan 2022 11:32:35 -0500 Message-ID: <2258970.1643128355@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Yura Sokolov writes: > В Вт, 25/01/2022 в 21:20 +1300, David Rowley пишет: >> The reason I didn't think it was worth adding a new test was that no >> tests were added in the original commit. Existing tests did cover it, > Existed tests didn't catched the issue. It is pitty fix is merged > without test case it fixes. I share David's skepticism about the value of a test case. The failure mode that seems likely to me is some other code path making the same mistake, which a predetermined test would not catch. Therefore, what I think could be useful is some very-late-stage assertion check (probably in createplan.c) verifying that the child of a Gather is parallel-aware. Or maybe the condition needs to be more general than that, but anyway the idea is for the back end of the planner to verify that we didn't build a silly plan. regards, tom lane