Re: MAX_BACKENDS size (comment accuracy)

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>, Jacob Brazeal <jacob.brazeal@gmail.com>, pgsql-hackers@postgresql.org
Date: 2025-02-24T20:38:24Z
Lists: pgsql-hackers
Hi,

On 2025-02-24 13:52:51 -0600, Nathan Bossart wrote:
> The recent commits for this drew my attention to the comment for
> MAX_BACKENDS.  Specifically, it says we check the value in
> RegisterBackgroundWorker() (which appears to have been untrue since we
> added max_worker_processes) and relevant GUC check hooks (which I removed
> last year in commit 0b1fe14).  I wrote a short patch to fix this, which I
> intend to commit soon unless there is feedback.

Makes sense.

Greetings,

Andres Freund



Commits

  1. Fix comment for MAX_BACKENDS.

  2. Add static asserts for MAX_BACKENDS limiting factors

  3. Base LWLock limits directly on MAX_BACKENDS

  4. Move MAX_BACKENDS to procnumber.h

  5. bufmgr: Make it easier to change number of buffer state bits

  6. Remove check hooks for GUCs that contribute to MaxBackends.

  7. Allow Pin/UnpinBuffer to operate in a lockfree manner.