agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Nathan Bossart <[email protected]>
Subject: [PATCH v1 1/1] Fix comment for MAX_BACKENDS.
Date: Mon, 24 Feb 2025 13:40:30 -0600

This comment mentions that we check the configured number of
backends does not exceed MAX_BACKENDS in RegisterBackgroundWorker()
and relevant GUC check hooks, neither of which is true anymore.  To
fix, adjust this comment to state that we do the check in
InitializeMaxBackends().

Oversights in commits 6bc8ef0b7f and 0b1fe1413e.
---
 src/include/storage/procnumber.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/include/storage/procnumber.h b/src/include/storage/procnumber.h
index 75c2c7a17c0..2ddaaf0c646 100644
--- a/src/include/storage/procnumber.h
+++ b/src/include/storage/procnumber.h
@@ -32,8 +32,8 @@ typedef int ProcNumber;
  * currently realistic configurations. Even if that limitation were removed,
  * we still could not a) exceed 2^23-1 because inval.c stores the ProcNumber
  * as a 3-byte signed integer, b) INT_MAX/4 because some places compute
- * 4*MaxBackends without any overflow check.  This is rechecked in the
- * relevant GUC check hooks and in RegisterBackgroundWorker().
+ * 4*MaxBackends without any overflow check.  We check that the configured
+ * number of backends does not exceed MAX_BACKENDS in InitializeMaxBackends().
  */
 #define MAX_BACKENDS_BITS		18
 #define MAX_BACKENDS			((1U << MAX_BACKENDS_BITS)-1)
-- 
2.39.5 (Apple Git-154)


--QnVX/ru2RzJGDjUg--





view thread (2+ messages)

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: [email protected]
  Cc: [email protected]
  Subject: Re: [PATCH v1 1/1] Fix comment for MAX_BACKENDS.
  In-Reply-To: <no-message-id-46523@localhost>

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

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