Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Maxim Orlov <orlovmg(at)gmail(dot)com>, 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-08 04:30:34
Message-ID: CA+hUKG+rBfs9GtsNCrbosNNiQKY94L61UuqraH6EvEUCfe_8Jg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 8, 2024 at 12:10 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2024-04-07 11:07:58 +1200, Thomas Munro wrote:
> > I thought of a better name for the bufmgr.c function though:
> > InvalidateUnpinnedBuffer(). That name seemed better to me after I
> > festooned it with warnings about why exactly it's inherently racy and
> > only for testing use.
>
> I still dislike that, fwiw, due to the naming similarity to
> InvalidateBuffer(), which throws away dirty buffer contents too. Which
> obviously isn't acceptable from "userspace". I'd just name it
> pg_buffercache_evict() - given that the commit message's first paragraph uses
> "it is useful to be able to evict arbitrary blocks" that seems to describe
> things at least as well as "invalidate"?

Alright, sold. I'll go with EvictUnpinnedBuffer() in bufmgr.c and
pg_buffercache_evict() in the contrib module.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-04-08 04:54:13 Re: Synchronizing slots from primary to standby
Previous Message Andy Fan 2024-04-08 04:25:00 Replace FunctionCall2Coll with FunctionCallInvoke