Re: ReadRecentBuffer() is broken for local buffer - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: ReadRecentBuffer() is broken for local buffer
Date
Msg-id 92fcbff3-1096-6c95-8488-b196daafcd3e@iki.fi
Whole thread Raw
In response to Re: ReadRecentBuffer() is broken for local buffer  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
On 25/07/2022 00:35, Thomas Munro wrote:
> On Mon, Jul 25, 2022 at 6:22 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>> ReadRecentBuffer() doesn't work for local buffers, i.e. for temp tables.
>> The bug is pretty clear if you look at the code:
> 
> -        bufHdr = GetBufferDescriptor(-recent_buffer - 1);
> +        int            b = -recent_buffer - 1;
> +
> +        bufHdr = GetLocalBufferDescriptor(b);
> 
> Ugh, right.  Obviously this code path is not reached currently.  I
> added the local path for completeness but I didn't think of the idea
> of testing it the way you suggested, hence thinko escaped into the
> wild.  That way of testing seems good and the patch indeed fixes the
> problem.

Pushed, thanks for the reviews.

- Heikki



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Next
From: Amit Kapila
Date:
Subject: Re: Support logical replication of DDLs