mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Add option to specify segment size in blocks
The tests don't have much coverage of segment related code, as we don't create large enough tables. To make it easier to test these paths, add a new option specifying the segment size in blocks. Set the new option to 6 blocks in one of the CI tasks. Smaller numbers currently fail one of the tests, for understandable reasons. While at it, fix some segment size related issues in the meson build. Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20221107171355.c23fzwanfzq2pmgt@awork3.anarazel.de
This commit is contained in:
63
configure
vendored
63
configure
vendored
@ -842,6 +842,7 @@ enable_dtrace
|
||||
enable_tap_tests
|
||||
with_blocksize
|
||||
with_segsize
|
||||
with_segsize_blocks
|
||||
with_wal_blocksize
|
||||
with_CC
|
||||
with_llvm
|
||||
@ -1551,6 +1552,8 @@ Optional Packages:
|
||||
--with-blocksize=BLOCKSIZE
|
||||
set table block size in kB [8]
|
||||
--with-segsize=SEGSIZE set table segment size in GB [1]
|
||||
--with-segsize-blocks=SEGSIZE_BLOCKS
|
||||
set table segment size in blocks [0]
|
||||
--with-wal-blocksize=BLOCKSIZE
|
||||
set WAL block size in kB [8]
|
||||
--with-CC=CMD set compiler (deprecated)
|
||||
@ -3731,8 +3734,6 @@ _ACEOF
|
||||
#
|
||||
# Relation segment size
|
||||
#
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
|
||||
$as_echo_n "checking for segment size... " >&6; }
|
||||
|
||||
|
||||
|
||||
@ -3756,12 +3757,52 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# this expression is set up to avoid unnecessary integer overflow
|
||||
# blocksize is already guaranteed to be a factor of 1024
|
||||
RELSEG_SIZE=`expr '(' 1024 / ${blocksize} ')' '*' ${segsize} '*' 1024`
|
||||
test $? -eq 0 || exit 1
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${segsize}GB" >&5
|
||||
|
||||
|
||||
|
||||
# Check whether --with-segsize-blocks was given.
|
||||
if test "${with_segsize_blocks+set}" = set; then :
|
||||
withval=$with_segsize_blocks;
|
||||
case $withval in
|
||||
yes)
|
||||
as_fn_error $? "argument required for --with-segsize-blocks option" "$LINENO" 5
|
||||
;;
|
||||
no)
|
||||
as_fn_error $? "argument required for --with-segsize-blocks option" "$LINENO" 5
|
||||
;;
|
||||
*)
|
||||
segsize_blocks=$withval
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
segsize_blocks=0
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# If --with-segsize-blocks is non-zero, it is used, --with-segsize
|
||||
# otherwise. segsize-blocks is only really useful for developers wanting to
|
||||
# test segment related code. Warn if both are used.
|
||||
if test $segsize_blocks -ne 0 -a $segsize -ne 1; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: both --with-segsize and --with-segsize-blocks specified, --with-segsize-blocks wins" >&5
|
||||
$as_echo "$as_me: WARNING: both --with-segsize and --with-segsize-blocks specified, --with-segsize-blocks wins" >&2;}
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
|
||||
$as_echo_n "checking for segment size... " >&6; }
|
||||
if test $segsize_blocks -eq 0; then
|
||||
# this expression is set up to avoid unnecessary integer overflow
|
||||
# blocksize is already guaranteed to be a factor of 1024
|
||||
RELSEG_SIZE=`expr '(' 1024 / ${blocksize} ')' '*' ${segsize} '*' 1024`
|
||||
test $? -eq 0 || exit 1
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${segsize}GB" >&5
|
||||
$as_echo "${segsize}GB" >&6; }
|
||||
else
|
||||
RELSEG_SIZE=$segsize_blocks
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${RELSEG_SIZE} blocks" >&5
|
||||
$as_echo "${RELSEG_SIZE} blocks" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@ -15450,9 +15491,11 @@ _ACEOF
|
||||
|
||||
|
||||
|
||||
# If we don't have largefile support, can't handle segsize >= 2GB.
|
||||
if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
|
||||
as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
|
||||
# If we don't have largefile support, can't handle segment size >= 2GB.
|
||||
if test "$ac_cv_sizeof_off_t" -lt 8; then
|
||||
if expr $RELSEG_SIZE '*' $blocksize '>=' 2 '*' 1024 '*' 1024; then
|
||||
as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
|
||||
fi
|
||||
fi
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
|
Reference in New Issue
Block a user