diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-13 20:32:37 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-13 20:32:37 +0000 |
commit | 1b87e24c4abcb9bca5b2542f7dd11433fa347993 (patch) | |
tree | bea5cf1ba5607591873650147b12ed4dcd10bbd8 /src/include/access/xlog.h | |
parent | e2f91389a579424d9b11d0ab4d0fa4cb9734c246 (diff) | |
download | postgresql-1b87e24c4abcb9bca5b2542f7dd11433fa347993.tar.gz postgresql-1b87e24c4abcb9bca5b2542f7dd11433fa347993.zip |
Change xlog page-header format to include StartUpID. Use the SUI to
detect case that next page in log came from an older run than the prior
page. This avoids the necessity to re-zero the log after recovery from
a crash, which is good because we need not risk destroying valuable log
information.
This forces another initdb since yesterday :-(. Need to get that log
reset utility done...
Diffstat (limited to 'src/include/access/xlog.h')
-rw-r--r-- | src/include/access/xlog.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h index dd079496ed6..fa51d68d39e 100644 --- a/src/include/access/xlog.h +++ b/src/include/access/xlog.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: xlog.h,v 1.19 2001/03/13 01:17:06 tgl Exp $ + * $Id: xlog.h,v 1.20 2001/03/13 20:32:37 tgl Exp $ */ #ifndef XLOG_H #define XLOG_H @@ -26,6 +26,9 @@ * really: * * SizeOfXLogRecord + xl_len + n_backup_blocks * (sizeof(BkpBlock) + BLCKSZ) + * + * rounded up to a MAXALIGN boundary (so that all xlog records start on + * MAXALIGN boundaries). */ typedef struct XLogRecord { @@ -105,12 +108,13 @@ typedef struct XLogContRecord /* * Each page of XLOG file has a header like this: */ -#define XLOG_PAGE_MAGIC 0x17345169 /* can be used as WAL version indicator */ +#define XLOG_PAGE_MAGIC 0xD058 /* can be used as WAL version indicator */ typedef struct XLogPageHeaderData { - uint32 xlp_magic; /* magic value for correctness checks */ + uint16 xlp_magic; /* magic value for correctness checks */ uint16 xlp_info; /* flag bits, see below */ + StartUpID xlp_sui; /* StartUpID of first record on page */ } XLogPageHeaderData; #define SizeOfXLogPHD MAXALIGN(sizeof(XLogPageHeaderData)) @@ -119,6 +123,8 @@ typedef XLogPageHeaderData *XLogPageHeader; /* When record crosses page boundary, set this flag in new page's header */ #define XLP_FIRST_IS_CONTRECORD 0x0001 +/* All defined flag bits in xlp_info (used for validity checking of header) */ +#define XLP_ALL_FLAGS 0x0001 /* * We break each logical log file (xlogid value) into 16Mb segments. |