Hi,

On Tue, 3 Sept 2024 at 22:20, Noah Misch <n...@leadboat.com> wrote:
>
> On Tue, Sep 03, 2024 at 10:50:11AM -0700, Noah Misch wrote:
> > On Mon, Sep 02, 2024 at 03:20:12PM +0300, Nazir Bilal Yavuz wrote:
> > > Thanks, updated patches are attached.
> >
> > > +/*
> > > + * Ask the callback which block it would like us to read next, with a 
> > > small
> > > + * buffer in front to allow read_stream_unget_block() to work and to 
> > > allow the
> > > + * fast path to skip this function and work directly from the array.
> > >   */
> > >  static inline BlockNumber
> > >  read_stream_get_block(ReadStream *stream, void *per_buffer_data)
> >
> > v4-0001-Add-general-use-struct-and-callback-to-read-strea.patch introduced
> > this update to the read_stream_get_block() header comment, but we're not
> > changing read_stream_get_block() here.  I reverted this.

Sorry, it should be left from rebase. Thanks for reverting it.

> > Pushed with some other cosmetic changes.

Thanks!

> I see I pushed something unacceptable under ASAN.  I will look into that:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=grassquit&dt=2024-09-03%2017%3A47%3A20

I think it is related to the scope of BlockRangeReadStreamPrivate in
the collect_visibility_data() function. Attached a small fix for that.

-- 
Regards,
Nazir Bilal Yavuz
Microsoft
From 5393dfe6e2a0888cb33ad15f31def1691637564f Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavu...@gmail.com>
Date: Tue, 3 Sep 2024 22:35:00 +0300
Subject: [PATCH v5] Fix ASAN error introduced in ed1b1ee59f

---
 contrib/pg_visibility/pg_visibility.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/contrib/pg_visibility/pg_visibility.c b/contrib/pg_visibility/pg_visibility.c
index 9975e8876e6..db796e35cb2 100644
--- a/contrib/pg_visibility/pg_visibility.c
+++ b/contrib/pg_visibility/pg_visibility.c
@@ -490,6 +490,7 @@ collect_visibility_data(Oid relid, bool include_pd)
 	BlockNumber blkno;
 	Buffer		vmbuffer = InvalidBuffer;
 	BufferAccessStrategy bstrategy = GetAccessStrategy(BAS_BULKREAD);
+	BlockRangeReadStreamPrivate p;
 	ReadStream *stream = NULL;
 
 	rel = relation_open(relid, AccessShareLock);
@@ -505,8 +506,6 @@ collect_visibility_data(Oid relid, bool include_pd)
 	/* Create a stream if reading main fork. */
 	if (include_pd)
 	{
-		BlockRangeReadStreamPrivate p;
-
 		p.current_blocknum = 0;
 		p.last_exclusive = nblocks;
 		stream = read_stream_begin_relation(READ_STREAM_FULL,
-- 
2.45.2

Reply via email to