Re: ReadRecentBuffer() is broken for local buffer

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ReadRecentBuffer() is broken for local buffer
Date: 2022-07-25 06:10:45
Message-ID: 92fcbff3-1096-6c95-8488-b196daafcd3e@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25/07/2022 00:35, Thomas Munro wrote:
> On Mon, Jul 25, 2022 at 6:22 AM Heikki Linnakangas <hlinnaka(at)iki(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-07-25 06:13:36 Re: Support logical replication of DDLs
Previous Message Masahiko Sawada 2022-07-25 05:55:45 Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns