Fix comment for MAX_BACKENDS.
authorNathan Bossart <nathan@postgresql.org>
Mon, 24 Feb 2025 21:02:09 +0000 (15:02 -0600)
committerNathan Bossart <nathan@postgresql.org>
Mon, 24 Feb 2025 21:02:09 +0000 (15:02 -0600)
This comment mentions that we check that the configured number of
backends does not exceed MAX_BACKENDS in RegisterBackgroundWorker()
and relevant GUC check hooks, neither of which has those checks
anymore.  To fix, adjust this comment to say that we do the check
in InitializeMaxBackends().

Oversights in commits 6bc8ef0b7f and 0b1fe1413e.

Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/Z7zOEzz8lNjaU9yf%40nathan

src/include/storage/procnumber.h

index 75c2c7a17c05af4435e9f08050c0b944cb27a4c6..2ddaaf0c64600888d9384f26b113ebb67f2e9743 100644 (file)
@@ -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)