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 1sWEiW-00DzOh-KL for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jul 2024 12:34:08 +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 1sWEiU-00DCBG-Kh for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jul 2024 12:34:07 +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 1sWEiU-00DCA7-4S for pgsql-hackers@lists.postgresql.org; Tue, 23 Jul 2024 12:34:06 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sWEiS-00124y-0E for pgsql-hackers@lists.postgresql.org; Tue, 23 Jul 2024 12:34:05 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1fc611a0f8cso31907725ad.2 for ; Tue, 23 Jul 2024 05:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1721738043; x=1722342843; 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=lr6eKLsDEhh8Aokd2Z21eJiaZyWMqtO6PS9AXngqAtQ=; b=N3Vb3AVmNQAQe+1qTba+qulMA7cVFhyMYsdpJKe4ANdLMJMdEscO8MeciFLcejpXZx 4qIQgsfJaOOmTMIQxRjE3jnZ89NVNCI7R5PTk3+Z8hJ6tStBzZ63vmI27wZrx9nDDulw a8ix8KdQ0TptW3PJt6b9lFyXihFviUYwECkN4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721738043; x=1722342843; 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=lr6eKLsDEhh8Aokd2Z21eJiaZyWMqtO6PS9AXngqAtQ=; b=XM+C4bPANPHL8BCwxlYhLwwOlSvORpMNChzdURQOE+ftkHYPA+QZ6cq9OgC4PZ/2q+ rsa0+4QoevTLq1IH6yJ1IYzrOpxtp+JCb9kmRJ6H0GLPIU3YXr1tqM20T2FloS4kHmKk nT4a1hpoN6Il3soE0ybWo6j+E11/TauExhkySTehB9yuLkseNGDwUtVrAyc6b3P9YxIu ihZ9kjCuwz3t0C8dpvIGmLdBBiaH0pM4Svl68zpXQr3GdFoGeuUHnYuBN76OOiyNKxpd YUUUL8nboBANXFsY3MkendYw5N1POYRry5Q5a0gAKe6iG0HNLTB3DvV4L8E/y6tMqjSh Hm6w== X-Gm-Message-State: AOJu0YyVKneuE9RU21UphAb9JFG3BNafdGptRV+tRuqN9zqiC0ozpq1D cAb8yReRn/f4ypm8HMvzXjAxF6aoDxOINbyXHdF91hGFxGAEtHH74Tu68YOjtA== X-Google-Smtp-Source: AGHT+IHOsS7wlzW8uKsKlsEqlZUY2F5rgJrUKcvX/HAvzS1Xzt9V1ra9rK77djR+8XeZq92wmROWcw== X-Received: by 2002:a17:902:dac7:b0:1fd:8904:ecf6 with SMTP id d9443c01a7336-1fd8904f0f1mr63490765ad.21.1721738043115; Tue, 23 Jul 2024 05:34:03 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f28f97fsm74085375ad.75.2024.07.23.05.34.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jul 2024 05:34:02 -0700 (PDT) Date: Tue, 23 Jul 2024 05:34:00 -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: <20240723123400.64@rfd.leadboat.com> References: <20240711235209.f6.nmisch@google.com> <20240716121935.fa.nmisch@google.com> <20240717204147.09@rfd.leadboat.com> <20240720112718.68.nmisch@google.com> <20240720181405.5a.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 Mon, Jul 22, 2024 at 12:00:45PM +0300, Nazir Bilal Yavuz wrote: > On Sat, 20 Jul 2024 at 21:14, Noah Misch wrote: > > 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). > > I prefered renaming it as nblocks, since that is how it was used in > RelationCopyStorageUsingBuffer() before. Also, I realized that instead > of setting p.blocknum = 0; initializing blkno as 0 and using > p.blocknum = blkno makes sense. Because, p.blocknum and blkno should > always start with the same block number. The relevant patch is > attached. I felt the local variable change was not a clear improvement. It would have been fine for the original patch to do it in that style, but the style of the original patch was also fine. So I've pushed just the struct field rename.