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 1wIvB1-0000vR-11 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 May 2026 21:13:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wIvAy-00CVq7-2d for pgsql-hackers@arkaria.postgresql.org; Fri, 01 May 2026 21:13:32 +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.96) (envelope-from ) id 1wIvAy-00CVpw-1K for pgsql-hackers@lists.postgresql.org; Fri, 01 May 2026 21:13:32 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wIvAw-000000000mg-0BvF for pgsql-hackers@lists.postgresql.org; Fri, 01 May 2026 21:13:31 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 22FBD5DC73F for ; Fri, 01 May 2026 23:13:28 +0200 (CEST) Received: from s980.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 0979C5DC847; Fri, 01 May 2026 23:13:28 +0200 (CEST) Received: from localhost (unknown [172.22.191.5]) by s980.loopia.se (Postfix) with ESMTP id 035EE220156B; Fri, 01 May 2026 23:13:28 +0200 (CEST) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s471.loopia.se (amavis); dkim=pass (2048-bit key) header.d=yesql.se Received: from s980.loopia.se ([172.22.191.6]) by localhost (s471.loopia.se [172.22.190.35]) (amavis, port 10024) with LMTP id 98ZmSN2q57zN; Fri, 1 May 2026 23:13:27 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.236 Received: from smtpclient.apple (customer-89-255-232-236.stosn.net [89.255.232.236]) (Authenticated sender: daniel@yesql.se) by s980.loopia.se (Postfix) with ESMTPSA id 6555B22015A7; Fri, 01 May 2026 23:13:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1777670007; bh=rUNb86ppWUlf0XJYEUAz9nxsOxKbRLrzxXYAzOZmuJw=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=I8iwOn5yXM6gGQv4hAylLTvcI+F2TOlPnjITfiU/3ukNSO13y/ydnWdT1CPno1vak +xf0HSNg2BnQplhcLYHFm9H0O1/THaBmzz3f/mR/Cdboa57rKPrTlDzFtfPAaK18L6 uvrQAUSgKmI67dpxjQOij6eQF2xAakSx/FwjSm8H4Iqlm9660UIa0V2Kst5QnqxCdC 93ED/jPkNtUkaXt0h4QRfzmmkocVQkhu7J8C5Q6+e9qEYURsExXHXer4kusS05R+77 kd3gTwKPU6BhqUlAfJDt5rSrZsxRpAH+uEpXwfL8Wxwn5h66t1GkXXVWo4WOXcNiqJ Oah2PVHPy0vcA== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.2\)) Subject: Re: Changing the state of data checksums in a running cluster From: Daniel Gustafsson In-Reply-To: Date: Fri, 1 May 2026 23:13:16 +0200 Cc: Ayush Tiwari , PostgreSQL Hackers , Heikki Linnakangas , Tomas Vondra , Andres Freund , Bernd Helmle , Michael Paquier , Michael Banck Content-Transfer-Encoding: quoted-printable Message-Id: <525E0691-FDAD-4194-9228-592A2DB96749@yesql.se> References: <7357A519-3391-4F07-BC69-5C9C2B120792@yesql.se> <477897AE-1314-4724-9694-0BABC4F4ABDA@yesql.se> <5mv5vtbqj2xm2wmevsi22smyn32jtznva3ya3daih3ixh3onex@s5fyab63xt3c> <2535E72D-5979-4F58-A2D3-2AA4AA335C20@yesql.se> <775fddbc-4dec-413d-89bb-1a8186858ee6@vondra.me> <683618b7-0946-400e-8066-97067f32d448@vondra.me> <032619A2-D466-4A12-A524-98359D96AEA6@yesql.se> <300822bd-daeb-49e5-8af7-d7ce3af65adc@iki.fi> <46d52594-fa93-4fbe-ad97-dc3127a04dd8@iki.fi> <8B86AFB8-ACBC-44FC-A1AB-A58DB541A170@yesql.se> <452D5390-4F89-4DED-9835-8E9EA2A01E19@yesql.se> <4020B0AE-6286-462F-BD50-3AAD170F08C9@yesql.se> <30E2C103-2F50-4F9D-8868-E057250F55CA@yesql.se> <17BD06EB-3741-4921-AF60-6575FB4784ED@yesql.se> <9197F930-DDEB-4CAC-82A2-16FEC715CCE8@yesql.se> <6011EEE0-2D34-4A63-8B88-2437173486FE@yesql.se> To: SATYANARAYANA NARLAPURAM X-Mailer: Apple Mail (2.3776.700.51.11.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 1 May 2026, at 18:57, SATYANARAYANA NARLAPURAM = wrote: > While further testing this feature, I realized that = ProcessSingleRelationFork()=20 > unconditionally called log_newpage_buffer() for every page of every = relation=20 > during pg_enable_data_checksums(). This included unlogged relations,=20= > which by definition never generate WAL for data changes and are reset = to their > init fork on any recovery.=20 >=20 > Guard the log_newpage_buffer() call with RelationNeedsWAL() so that > unlogged relations still get their pages dirtied (ensuring the = checksum > is flushed to disk at the next checkpoint) but do not emit WAL. >=20 > Attached a patch to address this and added a test for the same. My = current > test checks if standby has main fork, I could just checked WAL to = verify this > using pg_waldump. Any other test ideas are welcome. Thanks for the report, I agree that this is an oversight that should be = fixed. Your patch looks good on first glance, I am travelling till Sunday = evening so will take another look when back in the office and will apply it then. = Thanks! -- Daniel Gustafsson