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 1q0A5v-0008VJ-AL for pgsql-hackers@arkaria.postgresql.org; Sat, 20 May 2023 00:05:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q0A5s-0004SK-7K for pgsql-hackers@arkaria.postgresql.org; Sat, 20 May 2023 00:05:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q0A5r-0004SA-TT for pgsql-hackers@lists.postgresql.org; Sat, 20 May 2023 00:05:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q0A5n-000ong-6U for pgsql-hackers@postgresql.org; Sat, 20 May 2023 00:05:07 +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 34K04weQ623597; Fri, 19 May 2023 20:04:58 -0400 From: Tom Lane To: Melanie Plageman cc: Andres Freund , Thomas Munro , Richard Guo , pgsql-hackers@postgresql.org Subject: Re: Wrong results from Parallel Hash Full Join In-reply-to: References: <20230412181452.cyfduw2ka2atqmii@awork3.anarazel.de> <20230419151704.xkkobswffutslj34@liskov> <20230419192051.xkgyj76akczpbjbs@awork3.anarazel.de> Comments: In-reply-to Justin Pryzby message dated "Thu, 20 Apr 2023 10:50:45 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <623595.1684541098.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 19 May 2023 20:04:58 -0400 Message-ID: <623596.1684541098@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I noticed that BF animal conchuela has several times fallen over on the test case added by 558c9d75f: diff -U3 /home/pgbf/buildroot/HEAD/pgsql.build/src/test/regress/expected/j= oin_hash.out /home/pgbf/buildroot/HEAD/pgsql.build/src/test/regress/result= s/join_hash.out --- /home/pgbf/buildroot/HEAD/pgsql.build/src/test/regress/expected/join_h= ash.out 2023-04-19 10:20:26.159840000 +0200 +++ /home/pgbf/buildroot/HEAD/pgsql.build/src/test/regress/results/join_ha= sh.out 2023-04-19 10:21:47.971900000 +0200 @@ -974,8 +974,8 @@ SELECT * FROM hjtest_matchbits_t1 t1 FULL JOIN hjtest_matchbits_t2 t2 ON = t1.id =3D t2.id; id | id = ----+---- - 1 | = | 2 + 1 | = (2 rows) = -- Test serial full hash join. Considering that this is a parallel plan, I don't think there's any mystery about why an ORDER-BY-less query might have unstable output order; the only mystery is why more of the buildfarm hasn't failed. Can we just add "ORDER BY t1.id" to this query? It looks like you get the same PHJ plan, although now underneath Sort/Gather Merge. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dconchuela&dt= =3D2023-04-19%2008%3A20%3A56 [2] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dconchuela&dt= =3D2023-05-03%2006%3A21%3A03 [3] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dconchuela&dt= =3D2023-05-19%2022%3A21%3A04