Hi all, I saw a that a patch was committed that exposed a configure switch for BLCKSZ. I was hoping that I could do that same for XLOG_BLCKSZ. I think I got the configure.in, sgml, pg_config_manual.h, and pg_config.h.in changes correct.
Regards, Mark
Index: configure =================================================================== RCS file: /projects/cvsroot/pgsql/configure,v retrieving revision 1.592 diff -c -r1.592 configure *** configure 2 May 2008 01:08:22 -0000 1.592 --- configure 2 May 2008 04:39:34 -0000 *************** *** 1374,1379 **** --- 1374,1380 ---- --with-libs=DIRS alternative spelling of --with-libraries --with-pgport=PORTNUM set default port number [5432] --with-blocksize=BLOCKSIZE set block size in kB [8] + --with-xlog-blocksize=BLOCKSIZE set xlog block size in kB [8] --with-segsize=SEGSIZE set segment size in GB [1] --with-tcl build Tcl modules (PL/Tcl) --with-tclconfig=DIR tclConfig.sh is in DIR *************** *** 2602,2607 **** --- 2603,2658 ---- _ACEOF + { echo "$as_me:$LINENO: checking for xlog block size" >&5 + echo $ECHO_N "checking for xlog block size... $ECHO_C" >&6; } + + pgac_args="$pgac_args with_xlog_blocksize" + + + # Check whether --with-xlog-blocksize was given. + if test "${with_xlog_blocksize+set}" = set; then + withval=$with_xlog_blocksize; + case $withval in + yes) + { { echo "$as_me:$LINENO: error: argument required for --with-xlog-blocksize option" >&5 + echo "$as_me: error: argument required for --with-xlog-blocksize option" >&2;} + { (exit 1); exit 1; }; } + ;; + no) + { { echo "$as_me:$LINENO: error: argument required for --with-xlog-blocksize option" >&5 + echo "$as_me: error: argument required for --with-xlog-blocksize option" >&2;} + { (exit 1); exit 1; }; } + ;; + *) + xlog_blocksize=$withval + ;; + esac + + else + xlog_blocksize=8 + fi + + + case ${xlog_blocksize} in + 1) XLOG_BLCKSZ=1024;; + 2) XLOG_BLCKSZ=2048;; + 4) XLOG_BLCKSZ=4096;; + 8) XLOG_BLCKSZ=8192;; + 16) XLOG_BLCKSZ=16384;; + 32) XLOG_BLCKSZ=32768;; + *) { { echo "$as_me:$LINENO: error: Invalid block size. Allowed values are 1,2,4,8,16,32." >&5 + echo "$as_me: error: Invalid block size. Allowed values are 1,2,4,8,16,32." >&2;} + { (exit 1); exit 1; }; } + esac + { echo "$as_me:$LINENO: result: ${xlog_blocksize}kB" >&5 + echo "${ECHO_T}${xlog_blocksize}kB" >&6; } + + + cat >>confdefs.h <<_ACEOF + #define XLOG_BLCKSZ ${XLOG_BLCKSZ} + _ACEOF + + # # File segment size # Index: configure.in =================================================================== RCS file: /projects/cvsroot/pgsql/configure.in,v retrieving revision 1.558 diff -c -r1.558 configure.in *** configure.in 2 May 2008 01:08:26 -0000 1.558 --- configure.in 2 May 2008 04:39:34 -0000 *************** *** 249,254 **** --- 249,278 ---- Changing BLCKSZ requires an initdb. ]) + AC_MSG_CHECKING([for xlog block size]) + PGAC_ARG_REQ(with, xlog-blocksize, [ --with-xlog-blocksize=BLOCKSIZE set xlog block size in kB [[8]]], + [xlog_blocksize=$withval], + [xlog_blocksize=8]) + case ${xlog_blocksize} in + 1) XLOG_BLCKSZ=1024;; + 2) XLOG_BLCKSZ=2048;; + 4) XLOG_BLCKSZ=4096;; + 8) XLOG_BLCKSZ=8192;; + 16) XLOG_BLCKSZ=16384;; + 32) XLOG_BLCKSZ=32768;; + *) AC_MSG_ERROR([Invalid block size. Allowed values are 1,2,4,8,16,32.]) + esac + AC_MSG_RESULT([${xlog_blocksize}kB]) + + AC_DEFINE_UNQUOTED([XLOG_BLCKSZ], ${XLOG_BLCKSZ}, [ + Size of a WAL file block. This need have no particular relation to BLCKSZ. + XLOG_BLCKSZ must be a power of 2, and if your system supports O_DIRECT I/O, + XLOG_BLCKSZ must be a multiple of the alignment requirement for direct-I/O + buffers, else direct I/O may fail. + + Changing XLOG_BLCKSZ requires an initdb. + ]) + # # File segment size # Index: doc/src/sgml/installation.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/installation.sgml,v retrieving revision 1.308 diff -c -r1.308 installation.sgml *** doc/src/sgml/installation.sgml 2 May 2008 01:08:26 -0000 1.308 --- doc/src/sgml/installation.sgml 2 May 2008 04:39:36 -0000 *************** *** 1104,1109 **** --- 1104,1123 ---- </varlistentry> <varlistentry> + <term><option>--with-xlog-blocksize=<replaceable>BLOCKSIZE</replaceable></option></term> + <listitem> + <para> + Set the <firstterm>xlog block size</>, in kilobytes. This is the unit + of storage and I/O within the WAL files. The default, 8 kilobytes, + is suitable for most situations; but other values may be useful + in special cases. + The value must be a power of 2 between 1 and 32 (kilobytes). + Note that changing this value requires an initdb. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>--disable-spinlocks</option></term> <listitem> <para> Index: src/include/pg_config.h.in =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/pg_config.h.in,v retrieving revision 1.131 diff -c -r1.131 pg_config.h.in *** src/include/pg_config.h.in 2 May 2008 01:08:27 -0000 1.131 --- src/include/pg_config.h.in 2 May 2008 04:39:37 -0000 *************** *** 36,41 **** --- 36,48 ---- Changing BLCKSZ requires an initdb. */ #undef BLCKSZ + /* Size of a WAL file block. This need have no particular relation to BLCKSZ. + XLOG_BLCKSZ must be a power of 2, and if your system supports O_DIRECT I/O, + XLOG_BLCKSZ must be a multiple of the alignment requirement for direct-I/O + buffers, else direct I/O may fail. + Changing XLOG_BLCKSZ requires an initdb. */ + #undef XLOG_BLCKSZ + /* Define to the default TCP port number on which the server listens and to which clients will try to connect. This can be overridden at run-time, but it's convenient if your clients have the right default compiled in. Index: src/include/pg_config_manual.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/pg_config_manual.h,v retrieving revision 1.32 diff -c -r1.32 pg_config_manual.h *** src/include/pg_config_manual.h 2 May 2008 01:08:27 -0000 1.32 --- src/include/pg_config_manual.h 2 May 2008 04:39:37 -0000 *************** *** 11,26 **** */ /* - * Size of a WAL file block. This need have no particular relation to BLCKSZ. - * XLOG_BLCKSZ must be a power of 2, and if your system supports O_DIRECT I/O, - * XLOG_BLCKSZ must be a multiple of the alignment requirement for direct-I/O - * buffers, else direct I/O may fail. - * - * Changing XLOG_BLCKSZ requires an initdb. - */ - #define XLOG_BLCKSZ 8192 - - /* * XLOG_SEG_SIZE is the size of a single WAL file. This must be a power of 2 * and larger than XLOG_BLCKSZ (preferably, a great deal larger than * XLOG_BLCKSZ). --- 11,16 ----
-- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches