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 1sVEb0-008jjU-5k for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2024 18:14:14 +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 1sVEax-000y2N-Gz for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2024 18:14:11 +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.94.2) (envelope-from ) id 1sVEaw-000y2F-VF for pgsql-hackers@lists.postgresql.org; Sat, 20 Jul 2024 18:14:11 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sVEau-000ZSb-AI for pgsql-hackers@lists.postgresql.org; Sat, 20 Jul 2024 18:14:09 +0000 Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-703ba2477bdso1351808a34.2 for ; Sat, 20 Jul 2024 11:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1721499247; x=1722104047; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=+h6+SSYClz35YyIdYYw71hGxjKotanp9s6IP3B//aHY=; b=Iej90CX4pSU1qSbcesGfvdfNuBo7rF754XvVCi8G8WK+hoV246ejSacVmJqXvT0ujt VWdQExZ5lMWbm5a6WM8YSHOuXJoLljaQlmeoQ1+NI8aROUhfcqEAwYfRYpHVzldE9P/M WzYXTWItvLuJ4ScY5GeAl7r1eam+qpEHhU2/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721499247; x=1722104047; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+h6+SSYClz35YyIdYYw71hGxjKotanp9s6IP3B//aHY=; b=TP565BzCzOT6YntnbR+cIJ8mIWAUGoVObP0R8UnqKY1qTgA9P4TC7exVvMNgvcDf25 5VqCiacBKoT6q8reqN6/TiVC0aO5sjLkCMrnQc2VLwr/NawW/t/zD9gbjSfriIyL4iKp /GgLpN8KQw3bQ5LDdGwNbuMDY8N/FLLl+gwMK+ad+dnMOsAGrayKH6ZM8oHQBrmpZSeH xUpeQshWF404kYhVsesLQq2EBgY3QPoPnCCUWjEc9geIGTPrtB0Z4o0KwkeA4ECh4wah CQoUL/nxJz/as6q2pVDd/FcbxeMfBQiMUy4fScwoaTUt9zjIyKIlKAdVZVpBlRIjqufs heUw== X-Gm-Message-State: AOJu0Yx2mOugMWJHs7sQ6HoHfdnIXAH28yEf2EKuMZEP2YkwQuFIxdmn 9k3JsIfKbRFZL+RTjyj0x/lRNCqbk6ULfxm0Sv8CXzNvACsOQ/4l1AKLL0H+4A== X-Google-Smtp-Source: AGHT+IFqOjGptcs9jO8rwh+CTgI8QzH0POBngTuMJchT4XazCURhgSY8scc2fcRBQRXwg+3ljrM7og== X-Received: by 2002:a05:6830:210e:b0:708:f8c1:b8cf with SMTP id 46e09a7af769-708fdaea6b3mr4367657a34.11.1721499247605; Sat, 20 Jul 2024 11:14:07 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60d6c1csm802958a34.37.2024.07.20.11.14.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jul 2024 11:14:07 -0700 (PDT) Date: Sat, 20 Jul 2024 11:14:05 -0700 From: Noah Misch To: Nazir Bilal Yavuz Cc: PostgreSQL Hackers Subject: Re: Use read streams in CREATE DATABASE command when the strategy is wal_log Message-ID: <20240720181405.5a.nmisch@google.com> References: <20240711235209.f6.nmisch@google.com> <20240716121935.fa.nmisch@google.com> <20240717204147.09@rfd.leadboat.com> <20240720112718.68.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Jul 20, 2024 at 03:01:31PM +0300, Nazir Bilal Yavuz wrote: > On Sat, 20 Jul 2024 at 14:27, Noah Misch wrote: > > > > On Thu, Jul 18, 2024 at 02:11:13PM +0300, Nazir Bilal Yavuz wrote: > > > v4 is attached. > > > > Removal of the PinBufferForBlock() comment about the "persistence = > > RELPERSISTENCE_PERMANENT" fallback started to feel like a loss. I looked for > > a way to re-add a comment about the fallback. > > https://coverage.postgresql.org/src/backend/storage/buffer/bufmgr.c.gcov.html > > shows no test coverage of that fallback, and I think the fallback is > > unreachable. Hence, I've removed the fallback in a separate commit. I've > > pushed that and your three patches. Thanks. > > Thanks for the separate commit and push! > > With the separate commit (e00c45f685), does it make sense to rename > the smgr_persistence parameter of the ReadBuffer_common() to > persistence? Because, ExtendBufferedRelTo() calls ReadBuffer_common() > with rel's persistence now, not with smgr's persistence. BMR_REL() doesn't set relpersistence, so bmr.relpersistence is associated with bmr.smgr and is unset if bmr.rel is set. That is to say, bmr.relpersistence is an smgr_persistence. It could make sense to change ReadBuffer_common() to take a BufferManagerRelation instead of the three distinct arguments. On a different naming topic, my review missed that field name copy_storage_using_buffer_read_stream_private.last_block doesn't fit how the field is used. Code uses it like an nblocks. So let's either rename the field or change the code to use it as a last_block (e.g. initialize it to nblocks-1, not nblocks).