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 1tniJd-000vlO-Tg for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Feb 2025 18:08:58 +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 1tniJf-001sbg-1y for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Feb 2025 18:08:57 +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 1tniJe-001sbR-OY for pgsql-hackers@lists.postgresql.org; Thu, 27 Feb 2025 18:08:57 +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.96) (envelope-from ) id 1tniJb-0001CK-1h for pgsql-hackers@postgresql.org; Thu, 27 Feb 2025 18:08:56 +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 51RI8lUj2600079; Thu, 27 Feb 2025 13:08:47 -0500 From: Tom Lane To: Andres Freund cc: Ranier Vilela , Melanie Plageman , Thomas Munro , Masahiko Sawada , Tomas Vondra , Noah Misch , vignesh C , Pg Hackers , Heikki Linnakangas , Nazir Bilal Yavuz , Robert Haas , "Andrey M. Borodin" Subject: Re: Confine vacuum skip logic to lazy_scan_skip In-reply-to: References: <3915749.1739574230@sss.pgh.pa.us> <626104.1739729538@sss.pgh.pa.us> Comments: In-reply-to Andres Freund message dated "Thu, 27 Feb 2025 12:49:34 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2600077.1740679727.1@sss.pgh.pa.us> Date: Thu, 27 Feb 2025 13:08:47 -0500 Message-ID: <2600078.1740679727@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > Ah, no, it isn't. But I still think the coverity alert and the patch don't > make sense, as per the below: Coverity's alert makes perfect sense if you posit that Coverity doesn't assume that this read_stream_next_buffer call will only be applied to a stream that has per_buffer_data_size > 0. (Even if it did understand that, I wouldn't assume that it's smart enough to see that the fast path will never be taken.) I wonder if it'd be a good idea to add something like Assert(stream->distance == 1); Assert(stream->pending_read_nblocks == 0); Assert(stream->per_buffer_data_size == 0); + Assert(per_buffer_data == NULL); in read_stream_next_buffer. I doubt that this will shut Coverity up, but it would help to catch caller coding errors, i.e. passing a per_buffer_data pointer when there's no per-buffer data. On the whole I doubt we can get rid of this warning without some significant redesign of the read_stream API, and I don't think it's worth the trouble. Coverity is a tool not a requirement. I'm content to just dismiss the warning. regards, tom lane