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.96) (envelope-from ) id 1wldqD-000IuY-0B for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jul 2026 02:34:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wldqC-001m5t-24 for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jul 2026 02:34:48 +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.96) (envelope-from ) id 1wldqC-001m5k-1C for pgsql-hackers@lists.postgresql.org; Mon, 20 Jul 2026 02:34:48 +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.98.2) (envelope-from ) id 1wldq9-00000001315-0qjN for pgsql-hackers@lists.postgresql.org; Mon, 20 Jul 2026 02:34:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 66K2YTJ01065815; Sun, 19 Jul 2026 22:34:29 -0400 From: Tom Lane To: Melanie Plageman cc: Fujii Masao , Robert Haas , Andrey Borodin , Andres Freund , Matthias van de Meent , PostgreSQL Hackers , Heikki Linnakangas Subject: Re: Why clearing the VM doesn't require registering vm buffer in wal record In-reply-to: References: <66mqpfyti3qhfttcsv6r2lbvqqd32rrmpn6i47ovrsnvguts46@gou54xc5jld3> Comments: In-reply-to Melanie Plageman message dated "Fri, 17 Jul 2026 16:51:46 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1065813.1784514869.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 19 Jul 2026 22:34:29 -0400 Message-ID: <1065814.1784514869@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Melanie Plageman writes: > I've committed this. Coverity complained about this patch: /srv/coverity/git/pgsql-git/postgresql/src/backend/access/heap/pruneheap.c= : 951 in heap_page_fix_vm_corruption() 945 MarkBufferDirtyHint(prstate->buffer, true); 946 } 947 = 948 if (do_clear_vm) 949 { 950 LockBuffer(prstate->vmbuffer, BUFFER_LOCK_EXCLUSIVE); >>> CID 1697133: Error handling issues (CHECKED_RETURN) >>> Calling "visibilitymap_clear" without checking return value (as is= done elsewhere 13 out of 14 times). 951 visibilitymap_clear(prstate->relation->rd_locator, prstate= ->block, 952 prstate->vmbuffer, 953 VISIBILITYMAP_VALID_BITS); 954 LockBuffer(prstate->vmbuffer, BUFFER_LOCK_UNLOCK); 955 prstate->old_vmbits =3D 0; 956 } I think it's right to complain --- if we check for failure everywhere else, why's it OK to not check here? If it is OK, a comment and an explicit cast to "(void)" would be appropriate. regards, tom lane