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.98.2) (envelope-from ) id 1xThnX-00000000Uzi-22aG for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Nov 2026 15:42:11 +0000 Received: from localhost ([127.0.0.1]:38212 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xThnU-0000000CJEo-3ACF for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Nov 2026 15:42:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:58340) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xThnU-0000000CJEe-1rza for pgsql-hackers@lists.postgresql.org; Wed, 18 Nov 2026 15:42:08 +0000 Received: from mail-wm2-x06.google.com ([2a00:1450:4864:31::6]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xThnS-00000000MqN-1TTA for pgsql-hackers@lists.postgresql.org; Wed, 18 Nov 2026 15:42:08 +0000 Received: by mail-wm2-x06.google.com with SMTP id 5b1f17b1804b1-4b76b2f6bd9so1777135e9.0 for ; Wed, 18 Nov 2026 07:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795016520; x=1795621320; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=2TuCB2k4HFqux8bPfSfexXRoNkl319NBcGLz47UzGYc=; b=hqNzgQE+rDF1fDDWJFzgQE+zEz5/XYLQwetXrsSGFDntnsUa9s3lPClK+ekCmJ1ibc 1amJnAcSZY4DqOv6ibkOK+z+a/eaXq2yQKuoothTnocv/etBsv6Kl59RBWis4phKQMWE Sbc5R3aCXWBfKVVYO7TnsdcNdnob33MfAVxMuE9YvRWKoNErU4fR+YF9DeE4H/kXPtRF 7EaAecHVRhV3UJ7YSj8w44FqKWpyHls5pDYLbnY5YTbHLCuAKcTMHS3B0jurQsoMToQj /uPNoQhpXpcv4yy7irvAJgPWHlltHNYjtYonAc/YapX9Q4HoyYkZ2TdKy60hn2k9eyG6 MQJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795016520; x=1795621320; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2TuCB2k4HFqux8bPfSfexXRoNkl319NBcGLz47UzGYc=; b=OBIzWeDh+kIrP7niFM43PzN9vnt3zVa8eTabR24dCeJNZjnYyoIGWcLLngIRT2hfhH /JU7ujMNdPZBBquv+A9D6s37jVCwYhNeRhhQziJAhh1Ya55RSvfbhNUwthgJpm+n4Cn4 1aOGi/FbKKY/H7G6i6K07ahAkFlaermkk+pwsrITS8PcfsIN79ngF+sMcrN+LTfrFxsA Z8K/pscpZKkhzKr57Nz9zE/OF6ILYZGrc6/c+9gxSlnqBRE7EidbBBL0NvNsykAZFWQG BF2cq2Ky23/XPqMDVaM3ZGFzvyc8HOOXq3TaxPI5MLVEFy4X+XoM/49GP8iN3MO/5cgd ytwg== X-Forwarded-Encrypted: i=1; AL+hErHu1YY1PeQ+fv6Kv2NZAaIMx8U/4VbkX2SyiaW9DT66nWvwdFa/M60Or32HwUvpA6Ag+sq8GvnO3+hQMTeg@lists.postgresql.org X-Gm-Message-State: APuU4Z9ssGEA63z5XPvQCqpkPGo+y7pc8BH8+P9IiXr88L1UrI3ZQ5c+ xLT89fpQWKPEFvcEvX12954A0FZ4fmklqWs1RKd1W1XkcES2/rm4b9aG X-Gm-Gg: AYBFou0raeQnkOpNuBKjjdovkMw98AqAQOmdrzetzU4mQ8/vd0qsUboiFMfjg6VUi2h 99SFWLBMqjOF+Bp/H9u9P4S8Nuk0tVGP7T+MSlbILcCUilZBaqjCXy0Vf71RkJH54Geubinfh7N lG1y0nrh0ze1wVQwf483wDfcbSjNYcvhvSFJMk8fWp2Q0mO96ctsD1JVUz+KLw5pGbNXh43O5XN QLz23ZDhVRKRfgBDQoye+bfZvBpVW6Ecl/EuXo9IsFqE6PKOQ8CWIvtnTGVpIdCqgl5s8qZrccV vqzXGMvPIRh2oE4BgvCDjUJck3Kiwm1O+kTVVH0BqfCjCejLASTPcYcCETlBd92GQ9vvIQbhLzH PHiJu6eL2qsgZisudaHUvOf5Fruohkab+4T5l4VjShcL8TfmMsp2obDJRLPRcRecTVOK+9xwX1s YDXEsANNb5B8A2xSvlop8qEBH4xHVO3z3kff5cCAgSzIE71Fyom4vF1EkXCFVP1zIw9utTcDafF S1wBLRRShn06gZEYMOxi6t+2Z9/rt+Hnf61KSGaDkV3zJjfr51NiPgf0Lau/RGVez11UPV9E+tP h5S3u+1x+WN/ca/F2SqeejgkdmaBRVyhLLtBS7G9CZmQ4tBT1ssRiQeYyHppsKvQC+yURXDTmLF 9O4EZ4HejiXOiHnIGWfQ08XKm/OLdFFSe8ctH3RFqok72xEYcnUXFkQKICPToZI23 X-Received: by 2002:a05:600c:501f:b0:4bb:6f67:ca0b with SMTP id 5b1f17b1804b1-4bb7da462b2mr60259925e9.29.1795016519714; Wed, 18 Nov 2026 07:41:59 -0800 (PST) Received: from [17.235.206.182] ([17.235.206.182]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb7e50e7c6sm34079435e9.0.2026.11.18.07.41.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Nov 2026 07:41:59 -0800 (PST) Message-ID: Date: Wed, 18 Nov 2026 23:41:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts To: Melanie Plageman Cc: Robert Haas , Michael Paquier , Rogers Wang , pgsql-hackers@lists.postgresql.org, Matthias van de Meent , =?UTF-8?Q?=C3=81lvaro_Herrera?= , Andres Freund References: <202602021525.qv4m7oge4eca@alvherre.pgsql> <6e62d593-a8b2-415d-834d-e54ed519bb04@gmail.com> <2889116c-7da1-4ab0-b10a-3fadb99c24e7@gmail.com> From: Zhijie Hou In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Wed, Nov18, 2026 at 06:47 AM Melanie Plageman wrote: > On Tue, Nov 17, 2026 at 10:21 AM Zhijie Hou wrote: > > > > I think we also need to increase shared_buffers (e.g., to 16MB), > > because $node->init(allows_streaming => 1) sets shared_buffers to > > 1MB internally, causing the pg_class pages to be evicted from > > shared_buffers before CREATE TABLE runs, so the test could not reach > > the old bug path. > > Ah, okay. I'll do that. The original test feels awfully fragile. Is > there something we could do to strengthen it? Like check that one of > the buffers is marked BM_PERMANENT somehow? It seems very trivial to > accidentally eliminate the coverage. And there are of course lots of > ways for those buffers to get evicted. Maybe we could add a few comments above the CREATE DATABASE command to give developers a hint, and if it's worth it, we could add a check after the command to verify that pg_class's pages stay in the buffer cache (But note that if we add this check, we'd better disable autovaccum to prevent background access): # Verify that scanning template1's pg_class performs zero disk reads, # confirming its pages were not evicted by CREATE DATABASE. is( $node->safe_psql( $db_template, q{ SELECT pg_stat_get_xact_blocks_fetched('pg_class'::regclass) - pg_stat_get_xact_blocks_hit('pg_class'::regclass) FROM pg_class HAVING sum(relpages) >= 0; }), "0", "template pg_class pages remain cached after CREATE DATABASE"); -- Best Regards, Zhijie Hou