Re: Use read streams in CREATE DATABASE command when the strategy is wal_log - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Use read streams in CREATE DATABASE command when the strategy is wal_log
Date
Msg-id 20240723123400.64@rfd.leadboat.com
Whole thread Raw
In response to Re: Use read streams in CREATE DATABASE command when the strategy is wal_log  (Nazir Bilal Yavuz <byavuz81@gmail.com>)
List pgsql-hackers
On Mon, Jul 22, 2024 at 12:00:45PM +0300, Nazir Bilal Yavuz wrote:
> On Sat, 20 Jul 2024 at 21:14, Noah Misch <noah@leadboat.com> 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.



pgsql-hackers by date:

Previous
From: Jeremy Schneider
Date:
Subject: Re: [18] Policy on IMMUTABLE functions and Unicode updates
Next
From: Peter Eisentraut
Date:
Subject: Re: replace strtok()