Re: Old BufferDesc refcount in PrintBufferDescs and PrintPinnedBufs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jacob Brazeal <jacob(dot)brazeal(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Old BufferDesc refcount in PrintBufferDescs and PrintPinnedBufs
Date: 2025-01-18 05:53:20
Message-ID: 2476413.1737179600@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jacob Brazeal <jacob(dot)brazeal(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-01-18 06:42:15 Re: Collation & ctype method table, and extension hooks
Previous Message Junwang Zhao 2025-01-18 05:49:23 Re: rename es_epq_active to es_epqstate