pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_buffercache_evict() function for testing.
Date: Mon, 08 Apr 2024 05:02:55 +0000
Message-ID: <E1rth9i-0014dZ-MS@gemulon.postgresql.org> (raw)

Add pg_buffercache_evict() function for testing.

When testing buffer pool logic, it is useful to be able to evict
arbitrary blocks.  This function can be used in SQL queries over the
pg_buffercache view to set up a wide range of buffer pool states.  Of
course, buffer mappings might change concurrently so you might evict a
block other than the one you had in mind, and another session might
bring it back in at any time.  That's OK for the intended purpose of
setting up developer testing scenarios, and more complicated interlocking
schemes to give stronger guararantees about that would likely be less
flexible for actual testing work anyway.  Superuser-only.

Author: Palak Chaturvedi <chaturvedipalak1911@gmail.com>
Author: Thomas Munro <thomas.munro@gmail.com> (docs, small tweaks)
Reviewed-by: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Cary Huang <cary.huang@highgo.ca>
Reviewed-by: Cédric Villemain <cedric.villemain+pgsql@abcsql.com>
Reviewed-by: Jim Nasby <jim.nasby@gmail.com>
Reviewed-by: Maxim Orlov <orlovmg@gmail.com>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/CALfch19pW48ZwWzUoRSpsaV9hqt0UPyaBPC4bOZ4W+c7FF566A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/13453eedd3f692f8dcf8e334396eee84f00fdde2

Modified Files
--------------
contrib/pg_buffercache/Makefile                    |  2 +-
contrib/pg_buffercache/meson.build                 |  1 +
.../pg_buffercache/pg_buffercache--1.4--1.5.sql    |  6 +++
contrib/pg_buffercache/pg_buffercache.control      |  2 +-
contrib/pg_buffercache/pg_buffercache_pages.c      | 20 +++++++
doc/src/sgml/pgbuffercache.sgml                    | 39 +++++++++++---
src/backend/storage/buffer/bufmgr.c                | 63 ++++++++++++++++++++++
src/include/storage/bufmgr.h                       |  2 +
8 files changed, 127 insertions(+), 8 deletions(-)



Message-ID: <E1rth9i-0014dZ-MS@gemulon.postgresql.org>
Permalink:  ../E1rth9i-0014dZ-MS@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rth9i-0014dZ-MS@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add pg_buffercache_evict() function for testing.
  In-Reply-To: <E1rth9i-0014dZ-MS@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox