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 1ubCpA-00F24e-M0 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Jul 2025 06:38:05 +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 1ubCp8-00451V-P8 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Jul 2025 06:38:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ubCp8-00451N-F3 for pgsql-hackers@lists.postgresql.org; Mon, 14 Jul 2025 06:38:03 +0000 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ubCp6-007Scu-2c for pgsql-hackers@lists.postgresql.org; Mon, 14 Jul 2025 06:38:02 +0000 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c23:110d:0:640:50bc:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 3D45960CFF; Mon, 14 Jul 2025 09:37:59 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6bf:803e:400:4de4:3a8b:e410:8039]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id vbDi6g4Gm4Y0-Y7sa8lXu; Mon, 14 Jul 2025 09:37:58 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1752475078; bh=u3hb7inYF56Ah1oBU0OMo143QZT1sMlUI8gwD8dqyEg=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=mRCHzNBYaqhmn2kMH5qJs36K+88ri2wNCcQo6KayHTHTu2LgeXTMV+scug3d8b6fX k10E7KKFJndHW3aBZBftjxI1OZBWDbmJd8nnk3mrT/hYTBC2zs2I0s3pvpWoNiBHf1 XHOasKNXcwpSwQbvhOKvYBY9tVrFWGVzidbmSMYI= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) From: Andrey Borodin In-Reply-To: Date: Mon, 14 Jul 2025 11:37:47 +0500 Cc: PostgreSQL Hackers , Andres Freund , Robert Haas Content-Transfer-Encoding: quoted-printable Message-Id: <87DD95AA-274F-4F4F-BAD9-7738E5B1F905@yandex-team.ru> References: To: Melanie Plageman X-Mailer: Apple Mail (2.3826.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 14 Jul 2025, at 00:15, Melanie Plageman = wrote: >=20 >>=20 >> Also, I'd prefer "page is not marked all-visible but visibility map = bit is set in relation" to emit XX001 for monitoring reasons, but again, = this is small note, while I need a broader picture. >=20 > Could you clarify what you mean by this? Are you talking about the > string representation of the visibility map bits in the WAL record > representations in heapdesc.c? This might be a bit off-topic for this thread, but as long as the patch = touches that code we can look into this too. If VM bit all-visible is set while page is not all-visible IndexOnlyScan = will show incorrect results. I observed this inconsistency few times on = production. Two persistent subsystems (VM and heap) contradict each other, that's = why I think this is a data corruption. Yes, we can repair the VM by = assuming heap to be the source of truth in this case. But we must also = emit ERRCODE_DATA_CORRUPTED XX001 code into the logs. In many cases this = will alert on-call SRE. To do so I propose to replace elog(WARNING,...) with = ereport(WARNING,(errcode(ERRCODE_DATA_CORRUPTED),..). Best regards, Andrey Borodin.=