Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

From: Maksim Milyutin <milyutinma(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Maxim Orlov <orlovmg(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Palak Chaturvedi <chaturvedipalak1911(at)gmail(dot)com>, Jim Nasby <jim(dot)nasby(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>
Subject: Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Date: 2024-04-29 18:47:41
Message-ID: 7f4f2ef7-460a-4395-bd58-eca4fca7c4c9@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.04.2024 21:16, Maksim Milyutin wrote:

> On 07.04.2024 02:07, Thomas Munro wrote:
>
>> So this is the version I plan to commit.
>>
>> +bool
>> +EvictUnpinnedBuffer(Buffer buf)
>> +{
>> ...
>> + /* This will return false if it becomes dirty or someone else pins it. */
>> + result = InvalidateVictimBuffer(desc);
>> +
>> + UnpinBuffer(desc);
>> +
>> + return result;
>> +}
>
>
> Hi, Thomas!
>
> Should not we call at the end the StrategyFreeBuffer() function to add
> target buffer to freelist and not miss it after invalidation?
>

Hello everyone!

Please take a look at this issue, current implementation of
EvictUnpinnedBuffer() IMO is erroneous - evicted buffers are lost
permanently and will not be reused again

--
Best regards,
Maksim Milyutin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2024-04-29 18:51:54 Re: Direct SSL connection with ALPN and HBA rules
Previous Message Heikki Linnakangas 2024-04-29 18:43:22 Re: Direct SSL connection with ALPN and HBA rules