From: Nathan Bossart Date: Mon, 24 Feb 2025 21:02:09 +0000 (-0600) Subject: Fix comment for MAX_BACKENDS. X-Git-Tag: REL_18_BETA1~772 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c56e8af75e081383e05cf544f372506c8da4efe7;p=thirdparty%2Fpostgresql.git Fix comment for MAX_BACKENDS. 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 Discussion: https://postgr.es/m/Z7zOEzz8lNjaU9yf%40nathan --- 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)