Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rnqxE-00FYkv-3M for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Mar 2024 02:17:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rnqxC-008MOI-Ek for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Mar 2024 02:17:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rnqxC-008MOA-4A for pgsql-hackers@lists.postgresql.org; Sat, 23 Mar 2024 02:17:50 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rnqx4-005wyw-M9 for pgsql-hackers@lists.postgresql.org; Sat, 23 Mar 2024 02:17:49 +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 42N2HQMI1229328; Fri, 22 Mar 2024 22:17:26 -0400 From: Tom Lane To: Jeff Davis cc: =?UTF-8?Q?=E8=B5=B5=E5=BA=AD=E6=B5=B7=28=E5=BA=AD=E7=AB=A0=29?= , pgsql-hackers , Heikki Linnakangas Subject: Re: sublink [exists (select xxx group by grouping sets ())] causes an assertion error In-reply-to: <7242a03fe0b52e8dd24b21fc8973738105e64990.camel@j-davis.com> References: <932664.1711124920@sss.pgh.pa.us> <7242a03fe0b52e8dd24b21fc8973738105e64990.camel@j-davis.com> Comments: In-reply-to Jeff Davis message dated "Fri, 22 Mar 2024 18:22:21 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1229326.1711160246.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 22 Mar 2024 22:17:26 -0400 Message-ID: <1229327.1711160246@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis writes: > On Fri, 2024-03-22 at 12:28 -0400, Tom Lane wrote: >> Thanks for the report.  I did some bisecting and found that the crash >> appears at Jeff's commit c8aeaf3ab (which introduced this assertion) >> and disappears at Heikki's c4649cce3 (which removed it).  So I would >> say that the problem is "this assertion is wrong", and we should fix >> the problem by fixing the assertion, not by hacking around in distant >> calling code.  On the whole, since this code has been dead for >> several versions, I'd be inclined to just remove the assertion. > c4649cce3 didn't add additional calls to LogicalTapeSetBlocks(), so I'm > not sure if the removal of the Assert was related to his changes, or if > he just realized the assertion was wrong and removed it along the way? My guess is he just zapped it because the code block was dependent on the "tape" abstraction which was going away. Heikki? > Also, without the assertion, the word "should" in the comment is > ambiguous (does it mean "must not" or something else), and it still > exists in master. Do we care about the calculation being wrong if > there's an unfinished write? I think it's actually fine. The callers of LogicalTapeSetBlocks only use the number for statistics or trace reporting, so precision isn't critical in the first place, but I think what they care about is the amount of data that's really been written out to files. The comment should be clarified, for sure. regards, tom lane