diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-04-03 23:35:05 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-04-03 23:35:05 +0000 |
| commit | eaef111396ef7e70c88979c7a82f6a8f918d9651 (patch) | |
| tree | 4ed22c6becb93bacba5e0700637a74d39928cbd9 /src/include | |
| parent | c8c864c26148bc8b8f48c228152e657102f7cb2b (diff) | |
| download | postgresql-eaef111396ef7e70c88979c7a82f6a8f918d9651.tar.gz | |
Define a separately configurable XLOG_BLCKSZ symbol for the page size
used within WAL files. Historically this was the same as the data file
BLCKSZ, but there's no necessary connection, and it's possible that
performance gains might ensue from reducing XLOG_BLCKSZ. In any case
distinguishing two symbols should improve code clarity. This commit
does not actually change the page size, only provide the infrastructure
to make it possible to do so. initdb forced because of addition of a
field to pg_control.
Mark Wong, with some help from Simon Riggs and Tom Lane.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/xlog_internal.h | 6 | ||||
| -rw-r--r-- | src/include/catalog/pg_control.h | 7 | ||||
| -rw-r--r-- | src/include/pg_config_manual.h | 15 |
3 files changed, 20 insertions, 8 deletions
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 9bf46c2831..6fbda53f39 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.11 2006/03/24 04:32:13 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.12 2006/04/03 23:35:04 tgl Exp $ */ #ifndef XLOG_INTERNAL_H #define XLOG_INTERNAL_H @@ -182,8 +182,8 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader; /* Check if an xrecoff value is in a plausible range */ #define XRecOffIsValid(xrecoff) \ - ((xrecoff) % BLCKSZ >= SizeOfXLogShortPHD && \ - (BLCKSZ - (xrecoff) % BLCKSZ) >= SizeOfXLogRecord) + ((xrecoff) % XLOG_BLCKSZ >= SizeOfXLogShortPHD && \ + (XLOG_BLCKSZ - (xrecoff) % XLOG_BLCKSZ) >= SizeOfXLogRecord) /* * The XLog directory and control file (relative to $PGDATA) diff --git a/src/include/catalog/pg_control.h b/src/include/catalog/pg_control.h index a1b123bd37..ba54fdc8e6 100644 --- a/src/include/catalog/pg_control.h +++ b/src/include/catalog/pg_control.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.27 2006/03/05 15:58:54 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.28 2006/04/03 23:35:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -22,7 +22,7 @@ /* Version identifier for this pg_control format */ -#define PG_CONTROL_VERSION 812 +#define PG_CONTROL_VERSION 820 /* * Body of CheckPoint XLOG records. This is declared here because we keep @@ -126,9 +126,10 @@ typedef struct ControlFileData * This data is used to make sure that configuration of this database is * compatible with the backend executable. */ - uint32 blcksz; /* block size for this DB */ + uint32 blcksz; /* data block size for this DB */ uint32 relseg_size; /* blocks per segment of large relation */ + uint32 xlog_blcksz; /* block size within WAL files */ uint32 xlog_seg_size; /* size of each WAL segment */ uint32 nameDataLen; /* catalog name field width */ diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index a5170b5f22..e41b11e831 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -6,7 +6,7 @@ * for developers. If you edit any of these, be sure to do a *full* * rebuild (and an initdb if noted). * - * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.20 2006/01/05 03:01:37 momjian Exp $ + * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.21 2006/04/03 23:35:05 tgl Exp $ *------------------------------------------------------------------------ */ @@ -44,8 +44,19 @@ #define RELSEG_SIZE (0x40000000 / 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. + */ +#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 BLCKSZ (preferably, a great deal larger than BLCKSZ). + * and larger than XLOG_BLCKSZ (preferably, a great deal larger than + * XLOG_BLCKSZ). * * Changing XLOG_SEG_SIZE requires an initdb. */ |
