Re: Old BufferDesc refcount in PrintBufferDescs and PrintPinnedBufs

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jacob Brazeal <jacob.brazeal@gmail.com>
Cc: pgsql-hackers@postgresql.org, Andres Freund <andres@anarazel.de>
Date: 2025-01-18T05:53:20Z
Lists: pgsql-hackers
Jacob Brazeal <jacob.brazeal@gmail.com> writes:
> In bufmgr.c we have the debugging functions PrintBufferDescs
> and PrintPinnedBufs, which are typically hidden behind the flag
> #ifdef NOT_USED. These functions reference the old buf->refcount and
> buf->flags fields, and so they no longer compile. I attached a patch to
> use BUF_STATE_GET_REFCOUNT instead and removed the reference to buf->flags.

Hmm.  So those functions have not compiled since 48354581a of
2016-04-10, and nobody's noticed.  Moreover, whatever use-case
they do have would be reduced a good deal by taking a buffer
lock (which might not be available, or our own process might
hold it already).

I'd vote for just removing them...

			regards, tom lane



Commits

  1. Remove PrintBufferDescs() and PrintPinnedBufs().