Re: Extension Enhancement: Buffer Invalidation in pg_buffercache - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Date
Msg-id CA+hUKG+CjngU9+7mfPsV6tA8Rze9keoV887mHxUL_9qiFUrjJA@mail.gmail.com
Whole thread Raw
In response to Re: Extension Enhancement: Buffer Invalidation in pg_buffercache  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
List pgsql-hackers
On second thoughts, I think the original "invalidate" terminology was
fine, no need to invent a new term.

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 suppose someone could propose an additional function
pg_buffercache_invalidate(db, tbspc, rel, fork, blocknum) that would
be slightly better in the sense that it couldn't accidentally evict
some innocent block that happened to replace the real target just
before it runs, but I don't think it matters much for this purpose and
it would still be racy on return (vacuum decides to load your block
back in) so I don't think it's worth bothering with.

So this is the version I plan to commit.

Attachment

pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: Flushing large data immediately in pqcomm
Next
From: David Rowley
Date:
Subject: Re: Add bump memory context type and use it for tuplesorts