aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/xlog.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-05-20 21:08:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-05-20 21:08:19 +0000
commita8d539f12498de52453c8113892cbf48cc62478d (patch)
tree70871681b9aea671e88bcccfd23c5707268493e4 /src/include/access/xlog.h
parent2f2717d14ff1c401a125d9cd3e2e5fcf71d8b9bb (diff)
downloadpostgresql-a8d539f12498de52453c8113892cbf48cc62478d.tar.gz
postgresql-a8d539f12498de52453c8113892cbf48cc62478d.zip
To support external compression of archived WAL data, add a flag bit to
WAL records that shows whether it is safe to remove full-page images (ie, whether or not an on-line backup was in progress when the WAL entry was made). Also make provision for an XLOG_NOOP record type that can be used to fill in the extra space when decompressing the data for restore. This is the portion of Koichi Suzuki's "full page writes" patch that has to go into the core database. The remainder of that work is two external compression and decompression programs, which for the time being will undergo separate development on pgfoundry. Per discussion. Also, twiddle the handling of BTREE_SPLIT records to ensure it'll be possible to compress them (the previous coding caused essential info to be omitted). The other commonly-used record types seem OK already, with the possible exception of GIN and GIST WAL records, which I don't understand well enough to opine on.
Diffstat (limited to 'src/include/access/xlog.h')
-rw-r--r--src/include/access/xlog.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index bb53a04b498..87ff6aba501 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.76 2007/01/05 22:19:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.77 2007/05/20 21:08:19 tgl Exp $
*/
#ifndef XLOG_H
#define XLOG_H
@@ -66,8 +66,7 @@ typedef struct XLogRecord
/*
* If we backed up any disk blocks with the XLOG record, we use flag bits in
* xl_info to signal it. We support backup of up to 3 disk blocks per XLOG
- * record. (Could support 4 if we cared to dedicate all the xl_info bits for
- * this purpose; currently bit 0 of xl_info is unused and available.)
+ * record.
*/
#define XLR_BKP_BLOCK_MASK 0x0E /* all info bits used for bkp blocks */
#define XLR_MAX_BKP_BLOCKS 3
@@ -77,6 +76,15 @@ typedef struct XLogRecord
#define XLR_BKP_BLOCK_3 XLR_SET_BKP_BLOCK(2) /* 0x02 */
/*
+ * Bit 0 of xl_info is set if the backed-up blocks could safely be removed
+ * from a compressed version of XLOG (that is, they are backed up only to
+ * prevent partial-page-write problems, and not to ensure consistency of PITR
+ * recovery). The compression algorithm would need to extract data from the
+ * blocks to create an equivalent non-full-page XLOG record.
+ */
+#define XLR_BKP_REMOVABLE 0x01
+
+/*
* Sometimes we log records which are out of transaction control.
* Rmgr may "or" XLOG_NO_TRAN into info passed to XLogInsert to indicate this.
*/