Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKMCt-0001VX-6g for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Aug 2022 15:59:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oKMCr-0000gp-I9 for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Aug 2022 15:59:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKMCr-0000Xn-7u for pgsql-hackers@lists.postgresql.org; Sat, 06 Aug 2022 15:59:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKMCo-000553-VC for pgsql-hackers@lists.postgresql.org; Sat, 06 Aug 2022 15:59:16 +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 276Fx4s2101581; Sat, 6 Aug 2022 11:59:04 -0400 From: Tom Lane To: Dilip Kumar cc: Andres Freund , Justin Pryzby , Robert Haas , Ashutosh Sharma , Maciek Sakrejda , Bruce Momjian , Alvaro Herrera , Andrew Dunstan , Heikki Linnakangas , PostgreSQL Hackers Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints In-reply-to: References: <20220802175043.GA13682@telsasoft.com> <2767668.1659476794@sss.pgh.pa.us> <20220802220416.GC13682@telsasoft.com> <20220802222334.umf5wsa2r63koppn@awork3.anarazel.de> <20220804212932.xyxzeprxvcnukg7o@awork3.anarazel.de> Comments: In-reply-to Dilip Kumar message dated "Fri, 05 Aug 2022 12:32:39 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <101579.1659801544.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 06 Aug 2022 11:59:04 -0400 Message-ID: <101580.1659801544@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dilip Kumar writes: > PFA patches for different problems discussed in the thread > 0001 - Fix the problem of skipping the empty block and buffer lock on > source buffer > 0002 - Remove fake relcache entry (same as 0001-BugfixInWalLogCreateDB.p= atch) > 0003 - Optimization to avoid extending block by block I pushed 0001, because it seems fairly critical to get that in before beta3. The others can stand more leisurely discussion. I note from https://coverage.postgresql.org/src/backend/storage/buffer/bufmgr.c.gcov.h= tml that the block-skipping path is actually taken in our tests (this won't be visible there for very much longer of course). So we actually *are* making a corrupt copy, and we haven't noticed. This is perhaps not too surprising, because the only test case that I can find is in 020_createdb.pl: $node->issues_sql_like( [ 'createdb', '-T', 'foobar2', '-S', 'wal_log', 'foobar6' ], qr/statement: CREATE DATABASE foobar6 STRATEGY wal_log TEMPLATE foobar2/, 'create database with WAL_LOG strategy'); which is, um, not exactly a robust test of whether anything happened at all, let alone whether it was correct. I'm not real sure that this test would even notice if the CREATE reported failure. regards, tom lane