Skip to content

Commit dbaa4dc

Browse files
committed
Switch maximum of GUC huge_page_size to MAX_KILOBYTES
As documented in guc.h, MAX_KILOBYTES is used to cap GUC parameters that are measured in kilobytes of memory. This way, size_t values can fit in builds where sizeof(size_t) is 4 bytes. Unfortunately, huge_page_size has missed this aspect, causing calculation failures when setting this GUC to a value higher than MAX_KILOBYTES, up to INT_MAX. Oversight in d2bddc2. No backpatch is done, based on the lack of complaints. Reported-by: Daria Shanina <vilensipkdm@gmail.com> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/20260626.132415.904994526137946499.horikyota.ntt@gmail.com
1 parent 4df5fe3 commit dbaa4dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/backend/utils/misc/guc_parameters.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@
12521252
variable => 'huge_page_size',
12531253
boot_val => '0',
12541254
min => '0',
1255-
max => 'INT_MAX',
1255+
max => 'MAX_KILOBYTES',
12561256
check_hook => 'check_huge_page_size',
12571257
},
12581258

0 commit comments

Comments
 (0)